mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Add JS helpers to CombodoBackofficeToolbox to put/remove an element from fullscreen mode
This commit is contained in:
@@ -64,7 +64,34 @@ function SwitchTabMode()
|
||||
* @since 3.0.0
|
||||
*/
|
||||
const CombodoBackofficeToolbox = {
|
||||
|
||||
/**
|
||||
* Set the oElem in fullscreen mode, meaning that it will take all the screen and be above everything else.
|
||||
*
|
||||
* @param {object} oElem The jQuery object of the element
|
||||
* @constructor
|
||||
*/
|
||||
SetElementToFullscreenMode: function(oElem) {
|
||||
oElem.parents().addClass('ibo-has-fullscreen-descendant');
|
||||
oElem.addClass('ibo-is-fullscreen');
|
||||
},
|
||||
/**
|
||||
* Remove the oElem from fullscreen mode.
|
||||
* If none passed, all fullscreen elements will be removed from it
|
||||
*
|
||||
* @param {object|null} oElem The jQuery object of the element
|
||||
* @constructor
|
||||
*/
|
||||
RemoveElementFromFullscreenMode: function(oElem = null) {
|
||||
// If no element passed, remove any element from fullscreen mode
|
||||
if(oElem === null) {
|
||||
$(document).find('.ibo-has-fullscreen-descendant').removeClass('ibo-has-fullscreen-descendant');
|
||||
$(document).find('.ibo-is-fullscreen').removeClass('ibo-is-fullscreen');
|
||||
}
|
||||
else {
|
||||
oElem.parents().removeClass('ibo-has-fullscreen-descendant');
|
||||
oElem.removeClass('ibo-is-fullscreen');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Processing
|
||||
|
||||
Reference in New Issue
Block a user