SPR-953: bugfixes for content-wide nav
This commit is contained in:
parent
13c822c242
commit
30aa8e9544
5 changed files with 31 additions and 8 deletions
|
@ -173,7 +173,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// without wrapping UL
|
// without wrapping UL
|
||||||
nav > a.nav {
|
nav > a.nav,
|
||||||
|
nav div.nav a{
|
||||||
margin-left: -3.5rem;
|
margin-left: -3.5rem;
|
||||||
|
|
||||||
@media @screen_md-lg {
|
@media @screen_md-lg {
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
|
|
||||||
@fix_border-radius: 3px; // inputs, editbox (textarea), buttons, content, code, quicksearch, msg
|
@fix_border-radius: 3px; // inputs, editbox (textarea), buttons, content, code, quicksearch, msg
|
||||||
|
|
||||||
@toggle-showsidebar_width: 3.07rem; // shown sidebar after toggle
|
@toggle-showsidebar_width: 3.47rem; // shown sidebar after toggle
|
||||||
|
|
||||||
@headericons-margin-xxs: .45rem; // screen xxs margin-top for header icons
|
@headericons-margin-xxs: .45rem; // screen xxs margin-top for header icons
|
||||||
|
|
||||||
|
|
|
@ -166,7 +166,7 @@
|
||||||
.wide-content.showSidebar {
|
.wide-content.showSidebar {
|
||||||
.content {
|
.content {
|
||||||
.row > .col-xs-12 {
|
.row > .col-xs-12 {
|
||||||
margin-left: 2.1rem;
|
margin-left: 2.3rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
nav.nav-starred {
|
nav.nav-starred {
|
||||||
ul {
|
ul {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
&#sidebar-menu-starred {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
li {
|
li {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
svg {
|
svg {
|
||||||
|
|
|
@ -24,7 +24,7 @@ jQuery(function () {
|
||||||
if (!item) {
|
if (!item) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
window.sessionStorage.removeItem('sidebar-section-' + index + '-open');
|
window.sessionStorage.setItem('sidebar-section-' + index + '-open', 'false');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -254,12 +254,20 @@ jQuery(function () {
|
||||||
$templateMenus = $nav.find('> nav:not(.nav-main)'),
|
$templateMenus = $nav.find('> nav:not(.nav-main)'),
|
||||||
|
|
||||||
stModes = ['recent', 'media', 'index'],
|
stModes = ['recent', 'media', 'index'],
|
||||||
utModes = ['profile','admin'];
|
utModes = ['profile','admin'],
|
||||||
|
isWideContent = false;
|
||||||
|
|
||||||
/* set active states for site tool menu and user tool menu */
|
/* set active states for site tool menu and user tool menu */
|
||||||
setActive(stModes,$siteTools);
|
setActive(stModes,$siteTools);
|
||||||
setActive(utModes,$userTools);
|
setActive(utModes,$userTools);
|
||||||
|
|
||||||
|
if(jQuery('body').is('.wide-content')) {
|
||||||
|
window.sessionStorage.setItem('wide-content', true);
|
||||||
|
isWideContent = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* set data attributes for sessionStorage and check onload if one of the template menus should be opened */
|
/* set data attributes for sessionStorage and check onload if one of the template menus should be opened */
|
||||||
$templateMenus.each(function( index ) {
|
$templateMenus.each(function( index ) {
|
||||||
var $t = jQuery(this).find('.nav'),
|
var $t = jQuery(this).find('.nav'),
|
||||||
|
@ -267,14 +275,25 @@ jQuery(function () {
|
||||||
$toggler = ($t.is('a')) ? $t : $t.find('a:last'),
|
$toggler = ($t.is('a')) ? $t : $t.find('a:last'),
|
||||||
tIndex = y + index;
|
tIndex = y + index;
|
||||||
$toggler.data('index', tIndex);
|
$toggler.data('index', tIndex);
|
||||||
if (window.sessionStorage.getItem('sidebar-section-' + tIndex + '-open') === 'true') {
|
|
||||||
jQuery(this).find('.nav-panel').css('display', 'block');
|
var item = window.sessionStorage.getItem('sidebar-section-' + tIndex + '-open');
|
||||||
setTogglerClass($toggler,'is-open');
|
if (item) {
|
||||||
|
if(isWideContent) {
|
||||||
|
window.sessionStorage.setItem('sidebar-section-' + tIndex + '-open', 'false');
|
||||||
|
} else {
|
||||||
|
if (item === 'true') {
|
||||||
|
jQuery(this).find('.nav-panel').css('display', 'block');
|
||||||
|
setTogglerClass($toggler, 'is-open');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
//console.log(window.sessionStorage);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// main
|
// main
|
||||||
initContentNav();
|
initContentNav();
|
||||||
initSidebarToggling();
|
initSidebarToggling();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue