From f3e0eb2ea20c58b9f7908154a8b2976b073c2a45 Mon Sep 17 00:00:00 2001 From: lifei6671 Date: Fri, 24 Aug 2018 19:16:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=A7=A3=E5=86=B3=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E9=A1=B9=E7=9B=AEBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/js/editor.js | 11 +++++++++-- views/document/markdown_edit_template.tpl | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/static/js/editor.js b/static/js/editor.js index b72f8b03..32371895 100644 --- a/static/js/editor.js +++ b/static/js/editor.js @@ -106,6 +106,8 @@ function openCreateCatalogDialog($node) { var doc_id = $node ? $node.id : 0; $then.find("input[name='parent_id']").val(doc_id); + $then.find("input[name='doc_id']").val(''); + $then.find("input[name='doc_name']").val(''); $then.modal("show"); } @@ -265,11 +267,16 @@ $("#btnAddDocument").on("click",function () { }); //用于还原创建文档的遮罩层 $("#addDocumentModal").on("hidden.bs.modal",function () { - // $(this).find("form").html(window.sessionStorage.getItem("addDocumentModal")); + $(this).find("form").html(window.sessionStorage.getItem("MinDoc::addDocumentModal")); + var $then = $("#addDocumentModal"); + + $then.find("input[name='parent_id']").val(''); + $then.find("input[name='doc_id']").val(''); + $then.find("input[name='doc_name']").val(''); }).on("shown.bs.modal",function () { $(this).find("input[name='doc_name']").focus(); }).on("show.bs.modal",function () { - // window.sessionStorage.setItem("addDocumentModal",$(this).find("form").html()) + window.sessionStorage.setItem("MinDoc::addDocumentModal",$(this).find("form").html()) }); function showError($msg,$id) { diff --git a/views/document/markdown_edit_template.tpl b/views/document/markdown_edit_template.tpl index ebbeaaa4..efe3b373 100644 --- a/views/document/markdown_edit_template.tpl +++ b/views/document/markdown_edit_template.tpl @@ -136,7 +136,7 @@ - +