@@ -2,7 +2,7 @@ import $ from 'jquery';
22import { CommonParams } from './common.ts' ;
33import { Config } from './config.ts' ;
44import { ajaxRemoveMessage , ajaxShowMessage } from './ajax-message.ts' ;
5- import { getConfigValue , setConfigValue } from './functions/config .ts' ;
5+ import updateNavigationWidthConfig from './navigation/updateNavigationWidthConfig .ts' ;
66import handleRedirectAndReload from './functions/handleRedirectAndReload.ts' ;
77import isStorageSupported from './functions/isStorageSupported.ts' ;
88
@@ -908,7 +908,7 @@ const ResizeHandler = function () {
908908 */
909909 this . mouseup = function ( event ) : void {
910910 $ ( 'body' ) . css ( 'cursor' , '' ) ;
911- setConfigValue ( 'NavigationWidth' , event . data . resize_handler . getPos ( event ) ) ;
911+ updateNavigationWidthConfig ( event . data . resize_handler . getPos ( event ) ) ;
912912 $ ( '#topmenu' ) . menuResizer ( 'resize' ) ;
913913 $ ( document )
914914 . off ( 'mousemove' )
@@ -941,7 +941,7 @@ const ResizeHandler = function () {
941941 panelWidth = 240 ;
942942 }
943943
944- setConfigValue ( 'NavigationWidth' , panelWidth ) ;
944+ updateNavigationWidthConfig ( panelWidth ) ;
945945 event . data . resize_handler . setWidth ( panelWidth ) ;
946946 event . data . resize_handler . panelWidth = width ;
947947 } ;
@@ -985,27 +985,19 @@ const ResizeHandler = function () {
985985 $ ( document ) . on ( 'mousedown' , '#pma_navigation_resizer' , { 'resize_handler' : this } , this . mousedown ) ;
986986 $ ( document ) . on ( 'click' , '#pma_navigation_collapser' , { 'resize_handler' : this } , this . collapse ) ;
987987
988+ const navigationDiv = $ ( '#pma_navigation' ) ;
988989 // Add the correct arrow symbol to the collapser
989- $ ( '#pma_navigation_collapser' ) . html ( this . getSymbol ( $ ( '#pma_navigation' ) . width ( ) ) ) ;
990+ $ ( '#pma_navigation_collapser' ) . html ( this . getSymbol ( navigationDiv . width ( ) ) ) ;
990991 // Fix navigation tree height
991992 $ ( window ) . on ( 'resize' , this . treeResize ) ;
992993 // need to call this now and then, browser might decide
993994 // to show/hide horizontal scrollbars depending on page content width
994995 setInterval ( this . treeResize , 2000 ) ;
995996 this . treeResize ( ) ;
996- const callbackSuccessGetConfigValue = ( data ) => {
997- this . setWidth ( data ) ;
998- $ ( '#topmenu' ) . menuResizer ( 'resize' ) ;
999- } ;
1000-
1001- // Skip mobile
1002- if ( isLoadedOnMobile === false ) {
1003- // Make an init using the default found value
1004- const initialResizeValue = $ ( '#pma_navigation' ) . data ( 'config-navigation-width' ) ;
1005- callbackSuccessGetConfigValue ( initialResizeValue ) ;
1006- }
1007997
1008- getConfigValue ( 'NavigationWidth' , false , callbackSuccessGetConfigValue ) ;
998+ const initialResizeValue = Number ( navigationDiv . data ( 'config-navigation-width' ) ) ;
999+ this . setWidth ( initialResizeValue ) ;
1000+ $ ( '#topmenu' ) . menuResizer ( 'resize' ) ;
10091001 } ;
10101002
10111003 this . treeInit ( ) ;
0 commit comments