mirror of https://gitee.com/karson/fastadmin.git
优化简洁菜单和多级菜单逻辑判断
parent
77f10ce146
commit
91dea04a86
|
|
@ -39,6 +39,10 @@ class Index extends Backend
|
|||
config('fastadmin.' . $key, $cookieValue);
|
||||
}
|
||||
}
|
||||
//如同时启用简洁和多级菜单,简洁菜单将失效
|
||||
if (config('fastadmin.simplenav') && config('fastadmin.multiplenav')) {
|
||||
config('fastadmin.simplenav', false);
|
||||
}
|
||||
//左侧菜单
|
||||
list($menulist, $navlist, $fixedmenu, $referermenu) = $this->auth->getSidebar([
|
||||
'dashboard' => 'hot',
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
<h4 class="control-sidebar-heading">{:__('Layout Options')}</h4>
|
||||
<div class="form-group"><label class="control-sidebar-subheading"><input type="checkbox" data-config="simplenav" {if $Think.config.fastadmin.simplenav}checked{/if} class="pull-right"> {:__('Simple Nav')}</label><p>{:__("Simple nav tips")}</p></div>
|
||||
<div class="form-group"><label class="control-sidebar-subheading"><input type="checkbox" data-config="multiplenav" {if $Think.config.fastadmin.multiplenav}checked{/if} class="pull-right"> {:__('Multiple Nav')}</label><p>{:__("Toggle the top menu state (multiple or single)")}</p></div>
|
||||
<div class="form-group"><label class="control-sidebar-subheading"><input type="checkbox" data-config="multipletab" {if $Think.config.fastadmin.multipletab}checked{/if} class="pull-right"> {:__('Multiple Tab')}</label><p>{:__("Always show multiple tab when multiple nav is set")}</p></div>
|
||||
<div class="form-group"><label class="control-sidebar-subheading"><input type="checkbox" data-config="multipletab" {if !$Think.config.fastadmin.multiplenav}disabled{/if} {if $Think.config.fastadmin.multipletab}checked{/if} class="pull-right"> {:__('Multiple Tab')}</label><p>{:__("Always show multiple tab when multiple nav is set")}</p></div>
|
||||
<div class="form-group"><label class="control-sidebar-subheading"><input type="checkbox" data-layout="sidebar-collapse" class="pull-right"> {:__('Toggle Sidebar')}</label><p>{:__("Toggle the left sidebar's state (open or collapse)")}</p></div>
|
||||
<div class="form-group"><label class="control-sidebar-subheading"><input type="checkbox" data-enable="expandOnHover" class="pull-right"> {:__('Sidebar Expand on Hover')}</label><p>{:__('Let the sidebar mini expand on hover')}</p></div>
|
||||
<div class="form-group"><label class="control-sidebar-subheading"><input type="checkbox" data-menu="show-submenu" class="pull-right"> {:__('Show sub menu')}</label><p>{:__('Always show sub menu')}</p></div>
|
||||
|
|
|
|||
|
|
@ -335,10 +335,13 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi
|
|||
}, 0);
|
||||
});
|
||||
|
||||
// 切换简洁模式菜单
|
||||
// 切换简洁菜单
|
||||
$(document).on("click", "[data-config='simplenav']", function () {
|
||||
var value = $(this).prop("checked") ? 1 : 0;
|
||||
createCookie('simplenav', value);
|
||||
if ($("[data-config='multiplenav']").prop("checked")) {
|
||||
createCookie('multiplenav', 0);
|
||||
}
|
||||
location.reload();
|
||||
});
|
||||
|
||||
|
|
@ -346,6 +349,9 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi
|
|||
$(document).on("click", "[data-config='multiplenav']", function () {
|
||||
var value = $(this).prop("checked") ? 1 : 0;
|
||||
createCookie('multiplenav', value);
|
||||
if ($("[data-config='simplenav']").prop("checked")) {
|
||||
createCookie('simplenav', 0);
|
||||
}
|
||||
location.reload();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue