mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-22 00:32:16 +02:00
Merge remote-tracking branch 'origin/support/3.1' into support/3.2
This commit is contained in:
@@ -16,6 +16,21 @@ CKEDITOR.on('instanceReady', function (oEvent) {
|
|||||||
$('#'+ oEvent.editor.name).closest('form').trigger('submit');
|
$('#'+ 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 !
|
// For disabling the CKEditor at init time when the corresponding textarea is disabled !
|
||||||
|
|||||||
@@ -37,7 +37,9 @@ $(function () {
|
|||||||
sticky_sentinel_top: 'ibo-sticky-sentinel-top',
|
sticky_sentinel_top: 'ibo-sticky-sentinel-top',
|
||||||
},
|
},
|
||||||
js_selectors: {
|
js_selectors: {
|
||||||
global: {},
|
global: {
|
||||||
|
fullscreen_elements: '.ibo-is-fullscreen',
|
||||||
|
},
|
||||||
block: {
|
block: {
|
||||||
panel_header: '[data-role="ibo-panel--header"]:first',
|
panel_header: '[data-role="ibo-panel--header"]:first',
|
||||||
panel_header_sticky_sentinel_top: '[data-role="ibo-panel--header--sticky-sentinel-top"]: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...
|
// ... we consider the header as sticking...
|
||||||
.on('enter', function () {
|
.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();
|
me._onHeaderBecomesSticky();
|
||||||
})
|
})
|
||||||
// ... and when it comes back in the viewport, it stops.
|
// ... and when it comes back in the viewport, it stops.
|
||||||
.on('leave', function () {
|
.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();
|
me._onHeaderStopsBeingSticky();
|
||||||
})
|
})
|
||||||
.addTo(this.sticky_header_controller);
|
.addTo(this.sticky_header_controller);
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ $(function()
|
|||||||
extra_tabs_list_toggler: '[data-role="ibo-tab-container--extra-tabs-list-toggler"]',
|
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_tabs_list: '[data-role="ibo-tab-container--extra-tabs-list"]',
|
||||||
extra_tab_toggler: '[data-role="ibo-tab-container--extra-tab-toggler"]',
|
extra_tab_toggler: '[data-role="ibo-tab-container--extra-tab-toggler"]',
|
||||||
|
global: {
|
||||||
|
fullscreen_elements: '.ibo-is-fullscreen',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// the constructor
|
// the constructor
|
||||||
@@ -141,6 +144,10 @@ $(function()
|
|||||||
// Resize of the tab container
|
// Resize of the tab container
|
||||||
if(window.IntersectionObserver) {
|
if(window.IntersectionObserver) {
|
||||||
const oTabsListIntersectObs = new IntersectionObserver(function(aEntries, oTabsListIntersectObs){
|
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 => {
|
aEntries.forEach(oEntry => {
|
||||||
let oTabHeaderElem = $(oEntry.target);
|
let oTabHeaderElem = $(oEntry.target);
|
||||||
let bIsVisible = oEntry.isIntersecting;
|
let bIsVisible = oEntry.isIntersecting;
|
||||||
|
|||||||
Reference in New Issue
Block a user