Fix sticky tinyMCE menu offset [SCI-9131]

This commit is contained in:
Martin Artnik 2023-08-24 14:21:30 +02:00
parent 10a0ba9739
commit dfa2afa480

View file

@ -194,11 +194,12 @@ window.TinyMCE = (() => {
document.location.hash = `${textAreaObject.data('objectType')}_${textAreaObject.data('objectId')}`;
}
if ($('.navbar-secondary').length) {
editorToolbaroffset = $('.navbar-secondary').position().top + $('.navbar-secondary').height();
} else if ($('#main-nav').length) {
editorToolbaroffset = $('#main-nav').height();
}
let topMenuHeight = $('.sci--navigation--top-menu-container') ? $('.sci--navigation--top-menu-container').height() : 0;
let breadcrumbsHeight = $('.sci--layout-navigation-breadcrumbs') ? $('.sci--layout-navigation-breadcrumbs').height() : 0;
let secondaryNavHeight = $('.content-header.sticky-header') ? $('.content-header.sticky-header').height() : 0;
editorToolbaroffset = topMenuHeight + breadcrumbsHeight + secondaryNavHeight;
return tinyMCE.init({
cache_suffix: '?v=6.3.1', // This suffix should be changed any time library is updated