diff --git a/js/ckeditor.on-init.js b/js/ckeditor.on-init.js index eb725fb0b..9006b90f4 100644 --- a/js/ckeditor.on-init.js +++ b/js/ckeditor.on-init.js @@ -16,6 +16,20 @@ CKEDITOR.on('instanceReady', function (oEvent) { $('#'+ oEvent.editor.name).closest('form').trigger('submit'); } }); + // 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() { + 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'); + } else { + // The editor is not in fullscreen mode, remove the custom class + container.removeClass('ibo-is-fullscreen-non-intersecting'); + } + }); }); // For disabling the CKEditor at init time when the corresponding textarea is disabled ! diff --git a/js/components/panel.js b/js/components/panel.js index c17679e25..45a0db7b9 100644 --- a/js/components/panel.js +++ b/js/components/panel.js @@ -132,10 +132,18 @@ $(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) { + return; + } me._onHeaderBecomesSticky(); }) // ... 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) { + return; + } me._onHeaderStopsBeingSticky(); }) .addTo(this.sticky_header_controller); diff --git a/js/layouts/tab-container/tab-container.js b/js/layouts/tab-container/tab-container.js index 985127f00..3db0d03d8 100644 --- a/js/layouts/tab-container/tab-container.js +++ b/js/layouts/tab-container/tab-container.js @@ -141,6 +141,10 @@ $(function() // Resize of the tab container 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) { + return; + } aEntries.forEach(oEntry => { let oTabHeaderElem = $(oEntry.target); let bIsVisible = oEntry.isIntersecting;