İlk temizlik tamamlandı bir önceki projeden
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Document : tools.js
|
||||
* Author : pixelcave
|
||||
* Description: Various small tools
|
||||
*
|
||||
*/
|
||||
|
||||
// Import global dependencies
|
||||
import './../bootstrap.js';
|
||||
|
||||
// Tools
|
||||
export default class Tools {
|
||||
/*
|
||||
* Updates the color theme
|
||||
*
|
||||
*/
|
||||
static updateTheme(themeEl, themeName) {
|
||||
if (themeName === 'default') {
|
||||
if (themeEl.length) {
|
||||
themeEl.remove();
|
||||
}
|
||||
} else {
|
||||
if (themeEl.length) {
|
||||
themeEl.attr('href', themeName);
|
||||
} else {
|
||||
jQuery('#css-main')
|
||||
.after('<link rel="stylesheet" id="css-theme" href="' + themeName + '">');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns current browser's window width
|
||||
*
|
||||
*/
|
||||
static getWidth() {
|
||||
return window.innerWidth
|
||||
|| document.documentElement.clientWidth
|
||||
|| document.body.clientWidth;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user