Merge remote-tracking branch 'origin/support/3.2' into develop

This commit is contained in:
Molkobain
2024-04-02 10:29:30 +02:00
4 changed files with 34 additions and 2 deletions

View File

@@ -16,6 +16,21 @@ 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() {
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(sFullscreenClass);
} else {
// The editor is not in fullscreen mode, remove the custom class
container.removeClass(sFullscreenClass);
}
});
});
// For disabling the CKEditor at init time when the corresponding textarea is disabled !

View File

@@ -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',
@@ -132,10 +134,18 @@ $(function () {
})
// ... we consider the header as sticking...
.on('enter', function () {
// N°4631 - If a non-intersecting element is fullscreen, we do nothing
if ($(me.js_selectors.global.fullscreen_elements).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 ($(me.js_selectors.global.fullscreen_elements).length > 0) {
return;
}
me._onHeaderStopsBeingSticky();
})
.addTo(this.sticky_header_controller);

View File

@@ -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
@@ -141,6 +144,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 ($(me.js_selectors.global.fullscreen_elements).length > 0) {
return;
}
aEntries.forEach(oEntry => {
let oTabHeaderElem = $(oEntry.target);
let bIsVisible = oEntry.isIntersecting;

View File

@@ -1314,7 +1314,7 @@ $(function()
if(this._isElementSticking(oFormPanelBodyElem)) {
const oFormPanelElem = this._getFormPanelElem();
oFormPanelBodyElem.css({
'top': $(this.options.viewport_elem).offset().top,
'top': $(this.options.viewport_elem).offset()?.top, // N°7402 - In case viewport is the document, offset() will return undefined
'left': oFormPanelElem.offset().left,
'width': oFormPanelElem.outerWidth(),
});