mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-21 02:18:28 +02:00
Fix darkmode in mobile theme
This commit is contained in:
parent
bf3bb8999a
commit
dd97c0f316
@ -404,6 +404,7 @@
|
|||||||
$avatar.off().on('click',function(){
|
$avatar.off().on('click',function(){
|
||||||
$sidebar.toggleClass('avatarSubmenu',!$sidebar.hasClass('avatarSubmenu'));
|
$sidebar.toggleClass('avatarSubmenu',!$sidebar.hasClass('avatarSubmenu'));
|
||||||
});
|
});
|
||||||
|
jQuery('#topmenu_info_darkmode').click(function(){window.framework.toggle_darkmode(this);});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1039,21 +1040,23 @@
|
|||||||
*
|
*
|
||||||
* @param node
|
* @param node
|
||||||
*/
|
*/
|
||||||
toggle_darkmode: function()
|
toggle_darkmode: function(_node)
|
||||||
{
|
{
|
||||||
let node = document.getElementById('topmenu_darkmode');
|
let node = _node || document.getElementById('topmenu_darkmode');
|
||||||
let state = node.classList.contains('darkmode_on');
|
let state = node.classList.contains('darkmode_on');
|
||||||
egw.set_preference('common', 'darkmode',state?'0':'1');
|
egw.set_preference('common', 'darkmode',state?'0':'1');
|
||||||
this._setDarkMode(state?'0':'1');
|
this._setDarkMode(state?'0':'1');
|
||||||
if (state == 1)
|
if (state == 1)
|
||||||
{
|
{
|
||||||
node.classList.remove('darkmode_on');
|
node.classList.remove('darkmode_on');
|
||||||
|
if (node.hasChildNodes()) node.children[0].classList.remove('darkmode_on');
|
||||||
node.title = egw.lang('light mode');
|
node.title = egw.lang('light mode');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
node.classList.add('darkmode_on');
|
node.classList.add('darkmode_on');
|
||||||
node.title = egw.lang('dark mode');
|
node.title = egw.lang('dark mode');
|
||||||
|
if (node.hasChildNodes()) node.children[0].classList.add('darkmode_on');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user