瀏覽代碼

优化体验

Minho 8 年之前
父節點
當前提交
affd7b211e
共有 3 個文件被更改,包括 7 次插入9 次删除
  1. 5 6
      static/js/kancloud.js
  2. 1 0
      static/js/markdown.js
  3. 1 3
      views/document/markdown_edit_template.tpl

+ 5 - 6
static/js/kancloud.js

@@ -198,10 +198,9 @@ $(function () {
         }
     };
 
-    // var $node = window.jsTree.jstree().get_selected();
-    //
-    // if(typeof $node === "object") {
-    //     $node = window.jsTree.jstree().get_node({ id : $node[0] });
-    //     events.trigger('article.open',{ $url : $node.a_attr.href , $init : false, $id : $node.a_attr.id });
-    // }
+     var $node = window.jsTree.jstree().get_selected();
+    if(typeof $node === "object") {
+        $node = window.jsTree.jstree().get_node({ id : $node[0] });
+        events.trigger('article.open',{ $url : $node.a_attr.href , $init : true, $id : $node.a_attr.id });
+    }
 });

+ 1 - 0
static/js/markdown.js

@@ -53,6 +53,7 @@ $(function () {
         }
     });
 
+
     /**
      * 实现标题栏操作
      */

+ 1 - 3
views/document/markdown_edit_template.tpl

@@ -109,9 +109,7 @@
                 <div class="nav-plus pull-right" id="btnAddDocument" data-toggle="tooltip" data-title="创建目录" data-direction="right"><i class="fa fa-plus" aria-hidden="true"></i></div>
                 <div class="clearfix"></div>
             </div>
-            <div class="manual-tree" id="sidebar">
-
-            </div>
+            <div class="manual-tree" id="sidebar"> </div>
         </div>
         <div class="manual-editor-container" id="manualEditorContainer">
             <div class="manual-editormd">