UI: debug console improvements

This commit is contained in:
Tony Air 2020-05-14 02:22:15 +07:00
parent 4307eb559d
commit 27a300475a
5 changed files with 32 additions and 28 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@a2nt/ss-bootstrap-ui-webpack-boilerplate",
"version": "2.0.5",
"version": "2.0.6",
"author": "Tony Air <tony@twma.pro>",
"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.",

View File

@ -45,7 +45,8 @@ const HeaderUI = (($) => {
}
static dispose() {
console.log(`Destroying: ${NAME}`);
$Body.removeClass('shrink');
$(`#Header,.js${NAME},.footer,.jsFooterUI,.wrapper`).attr('css', '');
}
}

View File

@ -35,7 +35,7 @@ const SidebarUI = (($) => {
}
}
$(W).on(`${Events.AJAX} ${Events.LOADED}`, () => {
$(W).on(`${Events.LODEDANDREADY}`, () => {
SidebarUI.init();
});

View File

@ -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(
'<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,400i,700,700i&display=swap" rel="stylesheet">',
@ -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() {

View File

@ -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;