修改加载文档时设置保存按钮为不可用。

pull/25/merge
Minho 2017-04-28 18:19:03 +08:00
parent f39bd0263a
commit a386e23d60
2 changed files with 5 additions and 3 deletions

View File

@ -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;
}
/**
* 添加顶级文档

View File

@ -60,7 +60,7 @@
<div class="pull-right">
<a :href="'{{urlfor "DocumentController.Index" ":key" ""}}' + item.identify" title="查看文档" data-toggle="tooltip"><i class="fa fa-eye"></i> 查看文档</a>
<template v-if="item.role_id != 3">
<a :href="'/book/' + item.identify + '/edit'" title="编辑文档" data-toggle="tooltip"><i class="fa fa-edit" aria-hidden="true"></i> 编辑文档</a>
<a :href="'/docs/' + item.identify + '/edit'" title="编辑文档" data-toggle="tooltip"><i class="fa fa-edit" aria-hidden="true"></i> 编辑文档</a>
</template>
</div>
<div class="clearfix"></div>