diff --git a/package.json b/package.json index 212f799..f72b9b3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@a2nt/ss-bootstrap-ui-webpack-boilerplate", - "version": "2.0.5", + "version": "2.0.6", "author": "Tony Air ", "license": "MIT", "description": "This UI Kit allows you to build Bootstrap 4 webapp with some extra UI features. It's easy to extend and easy to convert HTML templates to CMS templates.", diff --git a/src/js/_components/_ui.header-footer.js b/src/js/_components/_ui.header-footer.js index 71739ef..5c8b7eb 100644 --- a/src/js/_components/_ui.header-footer.js +++ b/src/js/_components/_ui.header-footer.js @@ -45,7 +45,8 @@ const HeaderUI = (($) => { } static dispose() { - console.log(`Destroying: ${NAME}`); + $Body.removeClass('shrink'); + $(`#Header,.js${NAME},.footer,.jsFooterUI,.wrapper`).attr('css', ''); } } diff --git a/src/js/_components/_ui.sidebar.js b/src/js/_components/_ui.sidebar.js index e57b0b1..39e65aa 100755 --- a/src/js/_components/_ui.sidebar.js +++ b/src/js/_components/_ui.sidebar.js @@ -35,7 +35,7 @@ const SidebarUI = (($) => { } } - $(W).on(`${Events.AJAX} ${Events.LOADED}`, () => { + $(W).on(`${Events.LODEDANDREADY}`, () => { SidebarUI.init(); }); diff --git a/src/js/_layout.js b/src/js/_layout.js index 3585a96..23e83a5 100755 --- a/src/js/_layout.js +++ b/src/js/_layout.js @@ -28,9 +28,6 @@ const LayoutUI = (($) => { console.log(`Initializing: ${NAME}`); // your custom UI - // Fire further js when layout is ready - $(W).trigger(Events.LODEDANDREADY); - // Custom fonts $Body.append( '', @@ -42,6 +39,10 @@ const LayoutUI = (($) => { ga('create', 'UA-********-*', 'auto'); ga('send', 'pageview'); });*/ + + + // Fire further js when layout is ready + $(W).trigger(Events.LODEDANDREADY); } static dispose() { diff --git a/src/js/_main.js b/src/js/_main.js index 338bfd2..e73440d 100755 --- a/src/js/_main.js +++ b/src/js/_main.js @@ -24,6 +24,28 @@ const MainUI = (($) => { const NAME = 'MainUI'; + console.clear(); + console.info( + '%cUI Kit: https://github.com/a2nt/webpack-bootstrap-ui-kit by Tony Air (tony@twma.pro)', + 'color:yellow;font-size:16px', + ); + console.groupCollapsed('Events'); + Object.keys(Events).forEach((k) => { + console.info(`${k}: ${Events[k]}`); + }); + console.groupEnd('Events'); + + console.groupCollapsed('Consts'); + Object.keys(Consts).forEach((k) => { + console.info(`${k}: ${Consts[k]}`); + }); + console.groupEnd('Events'); + + console.groupCollapsed('Init'); + $(W).on(`${Events.LODEDANDREADY}`, () => { + console.groupEnd('Init'); + }); + // get browser locale //const Locale = $('html').attr('lang').substring(0, 2); @@ -330,7 +352,7 @@ const MainUI = (($) => { W.URLDetails.relative = location.split('#')[0]; W.URLDetails.hash = - hash >= 0 ? location.substr(location.indexOf('#')) : ''; + hash >= 0 ? location.substr(location.indexOf('#')) : ''; } // show site-wide alert @@ -365,10 +387,7 @@ const MainUI = (($) => { }); } - if ( - $AlertNotify.length && - typeof $AlertNotify[0].stop !== 'undefined' - ) { + if ($AlertNotify.length && typeof $AlertNotify[0].stop !== 'undefined') { $AlertNotify[0].stop(); } @@ -468,23 +487,6 @@ const MainUI = (($) => { }, 1000); }); - console.clear(); - console.info( - '%cUI Kit: https://github.com/a2nt/webpack-bootstrap-ui-kit by Tony Air (tony@twma.pro)', - 'color:yellow;font-size:16px', - ); - console.groupCollapsed('Events'); - Object.keys(Events).forEach((k) => { - console.info(`${k }: ${ Events[k]}`); - }); - console.groupEnd('Events'); - - console.groupCollapsed('Consts'); - Object.keys(Consts).forEach((k) => { - console.info(`${k }: ${ Consts[k]}`); - }); - console.groupEnd('Events'); - W.MainUI = MainUI; return MainUI;