mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 21:27:25 +02:00
Issue #5473 Collapsing adminMenu now functional.
This commit is contained in:
@@ -309,7 +309,7 @@ $ADMIN_TEMPLATE['menu']['button_active'] = '
|
|||||||
';
|
';
|
||||||
|
|
||||||
$ADMIN_TEMPLATE['menu']['start_sub'] = '
|
$ADMIN_TEMPLATE['menu']['start_sub'] = '
|
||||||
<ul class="plugin-navigation-sub nav nav-pills nav-stacked nav-second-level collapse" id="sub-{LINK_ID}">
|
<ul class="plugin-navigation-sub nav nav-pills nav-stacked nav-second-level {SUB_CLASS}" id="sub-{LINK_ID}">
|
||||||
';
|
';
|
||||||
|
|
||||||
$ADMIN_TEMPLATE['menu']['button_sub'] = '
|
$ADMIN_TEMPLATE['menu']['button_sub'] = '
|
||||||
|
@@ -1651,6 +1651,7 @@ class e_admin_dispatcher
|
|||||||
'data-target' => '#sub-' . $item['link_id'],
|
'data-target' => '#sub-' . $item['link_id'],
|
||||||
'role' => 'button'
|
'role' => 'button'
|
||||||
];
|
];
|
||||||
|
$item['sub_class'] = 'collapse';
|
||||||
$item['caret'] = true; // Indicate caret for sub-menu parents
|
$item['caret'] = true; // Indicate caret for sub-menu parents
|
||||||
|
|
||||||
// Check if any sub-item is active to expand the parent
|
// Check if any sub-item is active to expand the parent
|
||||||
@@ -1660,14 +1661,16 @@ class e_admin_dispatcher
|
|||||||
{
|
{
|
||||||
$parent = $subItem['group'];
|
$parent = $subItem['group'];
|
||||||
$var[$parent]['link_data']['aria-expanded'] = 'true';
|
$var[$parent]['link_data']['aria-expanded'] = 'true';
|
||||||
|
$item['sub_class'] = 'collapse in';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
elseif(!isset($item['link']))
|
elseif(!isset($item['link']))
|
||||||
{
|
{
|
||||||
$tmp = explode('/', trim($key, '/'), 3);
|
$tmp = explode('/', trim($key, '/'), 2);
|
||||||
$item['link'] = e_REQUEST_SELF . '?mode=' . $tmp[0] . '&action=' . ($tmp[1] ?? 'main');
|
$item['link'] = e_REQUEST_SELF . '?mode=' . $tmp[0] . '&action=' . ($tmp[1] ?? 'main');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1509,7 +1509,6 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; }
|
|||||||
$replace['SUB_CLASS'] = ' '.varset($e107_vars[$act]['sub_class'], 'e-hideme e-expandme');
|
$replace['SUB_CLASS'] = ' '.varset($e107_vars[$act]['sub_class'], 'e-hideme e-expandme');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$replace['SUB_MENU'] = $tp->parseTemplate($START_SUB, false, $replace);
|
$replace['SUB_MENU'] = $tp->parseTemplate($START_SUB, false, $replace);
|
||||||
$replace['SUB_MENU'] .= $this->admin(false, $active_page, $e107_vars[$act]['sub'], $tmpl, true, (isset($e107_vars[$act]['sort']) ? $e107_vars[$act]['sort'] : $sortlist));
|
$replace['SUB_MENU'] .= $this->admin(false, $active_page, $e107_vars[$act]['sub'], $tmpl, true, (isset($e107_vars[$act]['sort']) ? $e107_vars[$act]['sort'] : $sortlist));
|
||||||
$replace['SUB_MENU'] .= $tmpl['end_sub'] ?? '';
|
$replace['SUB_MENU'] .= $tmpl['end_sub'] ?? '';
|
||||||
|
@@ -1563,6 +1563,7 @@ thead th, thead tr, .table > thead > tr > th { border-bottom: 0; border-left:0;
|
|||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
background: #373737;
|
background: #373737;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.admin-left-panel-collapsed .admin-right-panel {
|
div.admin-left-panel-collapsed .admin-right-panel {
|
||||||
@@ -1683,7 +1684,7 @@ body {
|
|||||||
#admin-ui-nav-menu a { color: rgba(255,255,255,0.5); }
|
#admin-ui-nav-menu a { color: rgba(255,255,255,0.5); }
|
||||||
#admin-ui-nav-menu a:hover { color: rgba(255,255,255,1); }
|
#admin-ui-nav-menu a:hover { color: rgba(255,255,255,1); }
|
||||||
#admin-ui-nav-menu span.sidebar-toggle-panel { display: flex; justify-content: space-between;}
|
#admin-ui-nav-menu span.sidebar-toggle-panel { display: flex; justify-content: space-between;}
|
||||||
#admin-ui-nav-menu .caret-icon { font-size:1.2em; margin-top:8px }
|
#admin-ui-nav-menu .caret-icon { font-size:1.2em; margin-top:10px }
|
||||||
#admin-ui-nav-menu a:hover .caret-icon { color: rgba(255,255,255,1); }
|
#admin-ui-nav-menu a:hover .caret-icon { color: rgba(255,255,255,1); }
|
||||||
#admin-ui-nav-menu a:active { background-color: #2E77B6; color:white }
|
#admin-ui-nav-menu a:active { background-color: #2E77B6; color:white }
|
||||||
|
|
||||||
|
@@ -454,6 +454,29 @@ $(document).ready(function()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$('#admin-ui-nav-menu a[data-toggle="collapse"]').each(function() {
|
||||||
|
var $link = $(this);
|
||||||
|
var $caret = $link.find('.caret-icon');
|
||||||
|
if ($caret.length) {
|
||||||
|
var target = $($link.attr('data-target'));
|
||||||
|
|
||||||
|
// Initial state on page load
|
||||||
|
if (target.hasClass('in')) {
|
||||||
|
$caret.removeClass('fa-chevron-down').addClass('fa-chevron-up');
|
||||||
|
} else {
|
||||||
|
$caret.removeClass('fa-chevron-up').addClass('fa-chevron-down');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Listen for Bootstrap collapse events
|
||||||
|
target.on('shown.bs.collapse', function() {
|
||||||
|
$caret.removeClass('fa-chevron-down').addClass('fa-chevron-up');
|
||||||
|
}).on('hidden.bs.collapse', function() {
|
||||||
|
$caret.removeClass('fa-chevron-up').addClass('fa-chevron-down');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
$('input[data-loading-text]').on('click', function()
|
$('input[data-loading-text]').on('click', function()
|
||||||
{
|
{
|
||||||
@@ -726,7 +749,7 @@ $(document).ready(function()
|
|||||||
|
|
||||||
// Admin Prefs Navigation
|
// Admin Prefs Navigation
|
||||||
|
|
||||||
$(".plugin-navigation a").click(function () {
|
$("#admin-prefs .plugin-navigation a").click(function () {
|
||||||
$(".plugin-navigation a").each(function(index) {
|
$(".plugin-navigation a").each(function(index) {
|
||||||
var ot = $(this).attr("href");
|
var ot = $(this).attr("href");
|
||||||
if (ot.split('#')[1]) {
|
if (ot.split('#')[1]) {
|
||||||
@@ -735,6 +758,10 @@ $(document).ready(function()
|
|||||||
$(this).closest("li").removeClass("active");
|
$(this).closest("li").removeClass("active");
|
||||||
$(this).switchClass( "link-active", "link", 0 );
|
$(this).switchClass( "link-active", "link", 0 );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var id = $(this).attr("href"), hash = id.split('#')[1], form = $('.admin-menu')[0]; // FIXME - a better way to detect the page form
|
var id = $(this).attr("href"), hash = id.split('#')[1], form = $('.admin-menu')[0]; // FIXME - a better way to detect the page form
|
||||||
|
|
||||||
$(this).switchClass( "link", "link-active", 30 );
|
$(this).switchClass( "link", "link-active", 30 );
|
||||||
|
Reference in New Issue
Block a user