mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-02 21:20:08 +08:00
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:
commit
b94cab6e37
2 changed files with 10 additions and 2 deletions
4
app/assets/javascripts/sitewide/constants.js.erb
Normal file
4
app/assets/javascripts/sitewide/constants.js.erb
Normal file
|
@ -0,0 +1,4 @@
|
|||
const globalConstants = {
|
||||
name_truncation_length: <%= Constants::NAME_TRUNCATION_LENGTH %>,
|
||||
is_safari: /^((?!chrome|android).)*safari/i.test(navigator.userAgent)
|
||||
}
|
8
app/assets/javascripts/sitewide/tiny_mce.js
vendored
8
app/assets/javascripts/sitewide/tiny_mce.js
vendored
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue