Toolbar position fix for Safari

This commit is contained in:
Urban Rotnik 2019-06-04 15:55:44 +02:00
parent db399864f8
commit 3d3c6d5350
2 changed files with 10 additions and 2 deletions

View file

@ -0,0 +1,4 @@
const globalConstants = {
name_truncation_length: <%= Constants::NAME_TRUNCATION_LENGTH %>,
is_safari: /^((?!chrome|android).)*safari/i.test(navigator.userAgent)
}

View file

@ -1,4 +1,4 @@
/* global _ hljs tinyMCE SmartAnnotation I18n */ /* global _ hljs tinyMCE SmartAnnotation I18n globalConstants */
/* eslint-disable no-unused-vars */ /* eslint-disable no-unused-vars */
var TinyMCE = (function() { var TinyMCE = (function() {
@ -132,7 +132,11 @@ var TinyMCE = (function() {
editorToolbaroffset = 0; editorToolbaroffset = 0;
} }
editorToolbar.css('position', 'sticky'); if (globalConstants.is_safari) {
editorToolbar.css('position', '-webkit-sticky');
} else {
editorToolbar.css('position', 'sticky');
}
editorToolbar.css('top', editorToolbaroffset + 'px'); editorToolbar.css('top', editorToolbaroffset + 'px');
// Update scroll position after exit // Update scroll position after exit