Merge branch 'fixSidebarToggling' into 'master'
Fix sidebar toggling See merge request !46
This commit is contained in:
		
				commit
				
					
						927c20ea4f
					
				
			
		
					 1 changed files with 12 additions and 7 deletions
				
			
		|  | @ -12,18 +12,19 @@ jQuery(function () { | ||||||
|             $nav.find('div.nav-panel').hide(); // close all panels
 |             $nav.find('div.nav-panel').hide(); // close all panels
 | ||||||
|             jQuery('body').addClass('wide-content'); |             jQuery('body').addClass('wide-content'); | ||||||
|             removeToggleStorage(); |             removeToggleStorage(); | ||||||
|  |             window.sessionStorage.setItem('wide-content', true); | ||||||
|         }, |         }, | ||||||
| 
 | 
 | ||||||
|         /** |         /** | ||||||
|          * removes information about the toggle-state |          * removes information about the toggle-state | ||||||
|          */ |          */ | ||||||
|         removeToggleStorage = function () { |         removeToggleStorage = function () { | ||||||
|             for (var index=0; index <= sessionStorage.length; index += 1) { |             for (var index=0; index <= window.sessionStorage.length; index += 1) { | ||||||
|                 var item = sessionStorage.getItem('sidebar-section-' + index + '-open'); |                 var item = window.sessionStorage.getItem('sidebar-section-' + index + '-open'); | ||||||
|                 if (!item) { |                 if (!item) { | ||||||
|                     break; |                     continue; | ||||||
|                 } |                 } | ||||||
|                 sessionStorage.removeItem('sidebar-section-' + index + '-open'); |                 window.sessionStorage.removeItem('sidebar-section-' + index + '-open'); | ||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
| 
 | 
 | ||||||
|  | @ -32,7 +33,7 @@ jQuery(function () { | ||||||
|          */ |          */ | ||||||
|         setDefaultContent = function () { |         setDefaultContent = function () { | ||||||
|             jQuery('body').removeClass('wide-content'); |             jQuery('body').removeClass('wide-content'); | ||||||
| 
 |             window.sessionStorage.setItem('wide-content', false); | ||||||
|         }, |         }, | ||||||
| 
 | 
 | ||||||
|         /** |         /** | ||||||
|  | @ -60,7 +61,7 @@ jQuery(function () { | ||||||
|                     focusFirstSubLink($panel); |                     focusFirstSubLink($panel); | ||||||
|                 } |                 } | ||||||
|             }); |             }); | ||||||
|             sessionStorage.setItem('sidebar-section-' + $toggler.data('index') + '-open', !isOpen); |             window.sessionStorage.setItem('sidebar-section-' + $toggler.data('index') + '-open', !isOpen); | ||||||
|         }, |         }, | ||||||
| 
 | 
 | ||||||
|         /** |         /** | ||||||
|  | @ -123,7 +124,7 @@ jQuery(function () { | ||||||
|                     $toggler.parent('li').addClass('toggler'); |                     $toggler.parent('li').addClass('toggler'); | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 if (sessionStorage.getItem('sidebar-section-' + index + '-open') === 'true') { |                 if (window.sessionStorage.getItem('sidebar-section-' + index + '-open') === 'true') { | ||||||
|                     $wrap.css('display', 'block'); |                     $wrap.css('display', 'block'); | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|  | @ -166,6 +167,10 @@ jQuery(function () { | ||||||
|                     setWideContent(); |                     setWideContent(); | ||||||
|                 } |                 } | ||||||
|             }); |             }); | ||||||
|  | 
 | ||||||
|  |             if (window.sessionStorage.getItem('wide-content') === 'true') { | ||||||
|  |                 setWideContent(); | ||||||
|  |             } | ||||||
|         }, |         }, | ||||||
| 
 | 
 | ||||||
|         /** |         /** | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jana Deutschländer
				Jana Deutschländer