From f616985036eb54aaa7255371d760d438cf10064a Mon Sep 17 00:00:00 2001 From: wangbin05 Date: Wed, 24 Mar 2021 09:40:27 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=A2=9E=E5=8A=A0=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E5=88=97=E8=A1=A8=E5=B1=95=E5=BC=80=E3=80=81?= =?UTF-8?q?=E6=94=B6=E8=B5=B7=E5=8A=9F=E8=83=BD=202=E3=80=81=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=AE=8C=E6=88=90=E8=BF=94=E5=9B=9E=E6=8C=89=E9=92=AE?= =?UTF-8?q?=EF=BC=8C=E5=9B=9E=E5=88=B0=E7=BC=96=E8=BE=91=E5=89=8D=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views/document/default_read.tpl | 41 +++++++++++++++++++++++ views/document/markdown_edit_template.tpl | 3 +- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/views/document/default_read.tpl b/views/document/default_read.tpl index 3219cf8e..32518318 100644 --- a/views/document/default_read.tpl +++ b/views/document/default_read.tpl @@ -88,6 +88,10 @@
目录 搜索 + + + 展开 +
@@ -290,6 +294,43 @@ $(function () { return $(body).highlight(window.keyword); }); }); + + window.menuControl = true; + window.menuSetting = "open" ; + if (menuSetting == 'open' || menuSetting == 'first') { + $('#handlerMenuShow').find('span').text('收起'); + $('#handlerMenuShow').find('i').attr("class","fa fa-angle-down"); + if (menuSetting == 'open') { + window.jsTree.jstree().open_all() + } + if (menuSetting == 'first') { + window.jsTree.jstree('close_all') + var $target = $('.jstree-container-ul').children('li').filter(function(index){ + if($(this).attr('aria-expanded')==false||$(this).attr('aria-expanded')){ + return $(this) + }else{ + delete $(this) + } + }) + $target.children('i').trigger('click') + } + } else { + menuControl = false; + window.jsTree.jstree('close_all') + } + $('#handlerMenuShow').on('click', function(){ + if(menuControl){ + $(this).find('span').text('展开') + $(this).find('i').attr("class","fa fa-angle-left") + window.menuControl = false + window.jsTree.jstree('close_all') + }else{ + window.menuControl = true + $(this).find('span').text('收起') + $(this).find('i').attr("class","fa fa-angle-down") + window.jsTree.jstree().open_all() + } + }) }); {{.Scripts}} diff --git a/views/document/markdown_edit_template.tpl b/views/document/markdown_edit_template.tpl index badae2e4..58affae5 100644 --- a/views/document/markdown_edit_template.tpl +++ b/views/document/markdown_edit_template.tpl @@ -56,7 +56,8 @@
- + +