mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 14:45:56 +08:00
Fix sticky tinyMCE menu offset [SCI-9131]
This commit is contained in:
parent
10a0ba9739
commit
dfa2afa480
11
app/javascript/packs/tiny_mce.js
vendored
11
app/javascript/packs/tiny_mce.js
vendored
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue