mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-12-20 04:00:05 +08:00
1、增加文档目录列表展开、收起功能
2、编辑完成返回按钮,回到编辑前界面
This commit is contained in:
@@ -88,6 +88,10 @@
|
||||
<div class="tab-navg">
|
||||
<span data-mode="view" class="navg-item active"><i class="fa fa-align-justify"></i><b class="text">目录</b></span>
|
||||
<span data-mode="search" class="navg-item"><i class="fa fa-search"></i><b class="text">搜索</b></span>
|
||||
<span id="handlerMenuShow" style="float: right;display: inline-block;padding: 5px;cursor: pointer;">
|
||||
<i class="fa fa-angle-left" style="font-size: 20px;padding-right: 5px;"></i>
|
||||
<span class="pull-right" style="padding-top: 4px;">展开</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="tab-util">
|
||||
<span class="manual-fullscreen-switch">
|
||||
@@ -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()
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
{{.Scripts}}
|
||||
|
||||
Reference in New Issue
Block a user