From a386e23d6080baef42931c9a66f2dd873a3fc97c Mon Sep 17 00:00:00 2001 From: Minho Date: Fri, 28 Apr 2017 18:19:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8A=A0=E8=BD=BD=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E6=97=B6=E8=AE=BE=E7=BD=AE=E4=BF=9D=E5=AD=98=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E4=B8=BA=E4=B8=8D=E5=8F=AF=E7=94=A8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/js/markdown.js | 6 ++++-- views/book/index.tpl | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/static/js/markdown.js b/static/js/markdown.js index 2c17cf42..9705331c 100644 --- a/static/js/markdown.js +++ b/static/js/markdown.js @@ -155,11 +155,13 @@ $(function () { resetEditor(); if(res.errcode === 0){ + window.isLoad = true; window.editor.insertValue(res.data.markdown); window.editor.setCursor({line:0, ch:0}); var node = { "id" : res.data.doc_id,'parent' : res.data.parent_id === 0 ? '#' : res.data.parent_id ,"text" : res.data.doc_name,"identify" : res.data.identify,"version" : res.data.version}; pushDocumentCategory(node); + }else{ layer.msg("文档加载失败"); } @@ -291,7 +293,6 @@ $(function () { if(item.id === doc_id){ window.documentCategory[i].version = res.data.version; - console.log(res.data) break; } } @@ -314,11 +315,12 @@ $(function () { } function resetEditorChanged($is_change) { - if($is_change){ + if($is_change && !window.isLoad ){ $("#markdown-save").removeClass('disabled').addClass('change'); }else{ $("#markdown-save").removeClass('change').addClass('disabled'); } + window.isLoad = false; } /** * 添加顶级文档 diff --git a/views/book/index.tpl b/views/book/index.tpl index 64d9967c..8f5bcba5 100644 --- a/views/book/index.tpl +++ b/views/book/index.tpl @@ -60,7 +60,7 @@
查看文档