mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-29 13:38:44 +02:00
poc form SDK (change dependencies implementation)
This commit is contained in:
12
js/DI/app.js
12
js/DI/app.js
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Application handling.
|
||||
*
|
||||
* @returns {{init: init}}
|
||||
* @returns {{init: init, handleTooltips: handleTooltips}}
|
||||
* @constructor
|
||||
*/
|
||||
const App = function(){
|
||||
@@ -12,24 +12,32 @@ const App = function(){
|
||||
};
|
||||
|
||||
/**
|
||||
* init.
|
||||
* initialization.
|
||||
*
|
||||
*/
|
||||
function init(){
|
||||
|
||||
// dark theme button
|
||||
$(aSelectors.darkModeButton).on('click', function(){
|
||||
$('body').attr('data-bs-theme', this.ariaPressed === 'true' ? 'dark' : 'light');
|
||||
});
|
||||
|
||||
// dark theme button state
|
||||
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
$('body').attr('data-bs-theme', 'dark');
|
||||
$(aSelectors.darkModeButton).attr('aria-pressed', 'true');
|
||||
$(aSelectors.darkModeButton).toggleClass('active', true);
|
||||
}
|
||||
|
||||
// handle tooltips
|
||||
handleTooltips(document);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap tooltip initialization.
|
||||
*
|
||||
* @param oElement
|
||||
*/
|
||||
function handleTooltips(oElement){
|
||||
const tooltips = oElement.querySelectorAll("[data-bs-toggle='tooltip']");
|
||||
tooltips.forEach((el) => {
|
||||
|
||||
Reference in New Issue
Block a user