Merge pull request #1821 from urbanrotnik/ur-sci-3527-fix-toolbar-for-safari

Toolbar position fix for Safari [SCI-3527]
This commit is contained in:
Urban Rotnik 2019-06-04 15:59:34 +02:00 committed by GitHub
commit b94cab6e37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 */
var TinyMCE = (function() {
@ -132,7 +132,11 @@ var TinyMCE = (function() {
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');
// Update scroll position after exit