From 2f23a09f62bd71481f6aa6177af27ec73d648791 Mon Sep 17 00:00:00 2001 From: biezhi Date: Mon, 5 Nov 2018 09:51:49 +0800 Subject: [PATCH 1/2] :bug: fixed WYSIWYG editor load article empty. --- .../resources/static/admin/js/edit_article.js | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/resources/static/admin/js/edit_article.js b/src/main/resources/static/admin/js/edit_article.js index edfbbac0..b472bde4 100644 --- a/src/main/resources/static/admin/js/edit_article.js +++ b/src/main/resources/static/admin/js/edit_article.js @@ -166,24 +166,24 @@ var vm = new Vue({ }); $('#dropzone-container').hide(); } + + tale.get({ + url: '/admin/api/articles/content/' + cid, + success: function (data) { + if ($vm.article.fmtType === 'markdown') { + mditor.value = data; + } else { + htmlEditor.summernote("code", data); + } + } + }); + }, error: function (error) { console.log(error); alert(error || '数据加载失败'); } }); - - tale.get({ - url: '/admin/api/articles/content/' + cid, - success: function (data) { - if ($vm.article.fmtType === 'markdown') { - mditor.value = data; - } else { - htmlEditor.summernote("code", data); - } - } - }); - }, autoSave: function (callback) { var $vm = this; From ac3512038395d75ab8a2e5165daab57badecf7d6 Mon Sep 17 00:00:00 2001 From: biezhi Date: Mon, 5 Nov 2018 09:53:39 +0800 Subject: [PATCH 2/2] :bug: fixed WYSIWYG editor load article empty. --- .../resources/static/admin/js/edit_page.js | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/resources/static/admin/js/edit_page.js b/src/main/resources/static/admin/js/edit_page.js index b79f5aa7..bd64f33e 100644 --- a/src/main/resources/static/admin/js/edit_page.js +++ b/src/main/resources/static/admin/js/edit_page.js @@ -110,6 +110,17 @@ var vm = new Vue({ off: '关闭' } }); + + tale.get({ + url: '/admin/api/articles/content/' + cid, + success: function (data) { + if ($vm.article.fmtType === 'markdown') { + mditor.value = data; + } else { + htmlEditor.summernote("code", data); + } + } + }); }, error: function (error) { console.log(error); @@ -117,17 +128,6 @@ var vm = new Vue({ } }); - tale.get({ - url: '/admin/api/articles/content/' + cid, - success: function (data) { - if ($vm.article.fmtType === 'markdown') { - mditor.value = data; - } else { - htmlEditor.summernote("code", data); - } - } - }); - }, autoSave: function (callback) { var $vm = this;