Skip to content

Commit

Permalink
🐛 fixed otale#456
Browse files Browse the repository at this point in the history
  • Loading branch information
hellokaton committed Oct 7, 2018
1 parent eaa6239 commit f1bf247
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 deletions src/main/resources/static/admin/js/edit_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ var vm = new Vue({
url: '/admin/api/articles/' + cid,
success: function (data) {
$vm.article = data.payload;
if ($vm.article.fmtType === 'markdown') {
mditor.value = data.payload.content;
} else {
htmlEditor.summernote("code", data.payload.content);
}
$vm.article.createdTime = moment.unix($vm.article.created).format('YYYY-MM-DD HH:mm')

$('#allowComment').toggles({
Expand All @@ -121,6 +116,18 @@ var vm = new Vue({
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;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/admin/page/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ <h3 class="panel-title">编辑页面</h3>
</div>
</div>
#include('../article/_footer.html')
<script src="${cdnURL()}/js/edit_page.js?v=${version}" ></script>
<script src="/static/admin/js/edit_page.js?v=${version}" ></script>
</body>
</html>

0 comments on commit f1bf247

Please sign in to comment.