mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°4631 - Update fullscreen class
This commit is contained in:
@@ -19,15 +19,16 @@ CKEDITOR.on('instanceReady', function (oEvent) {
|
||||
// N°4631 - Add a custom class to the CKEditor container when it is in fullscreen mode
|
||||
// so elements know they should take into account intersecting with the editor
|
||||
oEvent.editor.on('maximize', function() {
|
||||
const sFullscreenClass = 'ibo-is-fullscreen';
|
||||
let container = this.container.getFirst( function( node ) {
|
||||
return node.type === CKEDITOR.NODE_ELEMENT && node.hasClass( 'cke_inner' );
|
||||
} );
|
||||
if (this.commands.maximize.state === CKEDITOR.TRISTATE_ON) {
|
||||
// The editor is in fullscreen mode, add the custom class
|
||||
container.addClass('ibo-is-fullscreen-non-intersecting');
|
||||
container.addClass(sFullscreenClass);
|
||||
} else {
|
||||
// The editor is not in fullscreen mode, remove the custom class
|
||||
container.removeClass('ibo-is-fullscreen-non-intersecting');
|
||||
container.removeClass(sFullscreenClass);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -37,7 +37,9 @@ $(function () {
|
||||
sticky_sentinel_top: 'ibo-sticky-sentinel-top',
|
||||
},
|
||||
js_selectors: {
|
||||
global: {},
|
||||
global: {
|
||||
fullscreen_elements: '.ibo-is-fullscreen',
|
||||
},
|
||||
block: {
|
||||
panel_header: '[data-role="ibo-panel--header"]:first',
|
||||
panel_header_sticky_sentinel_top: '[data-role="ibo-panel--header--sticky-sentinel-top"]:first',
|
||||
@@ -133,7 +135,7 @@ $(function () {
|
||||
// ... we consider the header as sticking...
|
||||
.on('enter', function () {
|
||||
// N°4631 - If a non-intersecting element is fullscreen, we do nothing
|
||||
if ($('.ibo-is-fullscreen-non-intersecting').length > 0) {
|
||||
if ($(me.js_selectors.global.fullscreen_elements).length > 0) {
|
||||
return;
|
||||
}
|
||||
me._onHeaderBecomesSticky();
|
||||
@@ -141,7 +143,7 @@ $(function () {
|
||||
// ... and when it comes back in the viewport, it stops.
|
||||
.on('leave', function () {
|
||||
// N°4631 - If a non-intersecting element is fullscreen, we do nothing
|
||||
if ($('.ibo-is-fullscreen-non-intersecting').length > 0) {
|
||||
if ($(me.js_selectors.global.fullscreen_elements).length > 0) {
|
||||
return;
|
||||
}
|
||||
me._onHeaderStopsBeingSticky();
|
||||
|
||||
@@ -32,6 +32,9 @@ $(function()
|
||||
extra_tabs_list_toggler: '[data-role="ibo-tab-container--extra-tabs-list-toggler"]',
|
||||
extra_tabs_list: '[data-role="ibo-tab-container--extra-tabs-list"]',
|
||||
extra_tab_toggler: '[data-role="ibo-tab-container--extra-tab-toggler"]',
|
||||
global: {
|
||||
fullscreen_elements: '.ibo-is-fullscreen',
|
||||
},
|
||||
},
|
||||
|
||||
// the constructor
|
||||
@@ -142,7 +145,7 @@ $(function()
|
||||
if(window.IntersectionObserver) {
|
||||
const oTabsListIntersectObs = new IntersectionObserver(function(aEntries, oTabsListIntersectObs){
|
||||
// N°4631 - If a non-intersecting element is fullscreen, we do nothing
|
||||
if ($('.ibo-is-fullscreen-non-intersecting').length > 0) {
|
||||
if ($(me.js_selectors.global.fullscreen_elements).length > 0) {
|
||||
return;
|
||||
}
|
||||
aEntries.forEach(oEntry => {
|
||||
|
||||
Reference in New Issue
Block a user