From 2b3e9dfbc90170371faf0395a0b37265165bb3e0 Mon Sep 17 00:00:00 2001 From: HarveyKandola Date: Fri, 6 Dec 2019 15:11:16 +0000 Subject: [PATCH] Stop TinyMCE dialogs from scrolling background --- .../components/section/wysiwyg/type-editor.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/gui/app/components/section/wysiwyg/type-editor.js b/gui/app/components/section/wysiwyg/type-editor.js index 80972726..12636a6b 100644 --- a/gui/app/components/section/wysiwyg/type-editor.js +++ b/gui/app/components/section/wysiwyg/type-editor.js @@ -23,6 +23,7 @@ export default Component.extend({ let page = this.get('page'); return `wysiwyg-editor-${page.id}`; }), + scrollFix: false, didReceiveAttrs() { this._super(...arguments); @@ -32,9 +33,16 @@ export default Component.extend({ didInsertElement() { this._super(...arguments); + if ($('html').css('overflow-y') === 'scroll') { + this.set('scrollFix', true); + $('html').css('overflow-y', 'unset'); + } else { + this.set('scrollFix', false); + } + schedule('afterRender', () => { let options = { - cache_suffix: '?v=510', + cache_suffix: '?v=513', selector: '#' + this.get('editorId'), relative_urls: false, browser_spellcheck: true, @@ -120,7 +128,7 @@ export default Component.extend({ }; if (typeof tinymce === 'undefined') { - $.getScript('/tinymce/tinymce.min.js?v=510', function () { + $.getScript('/tinymce/tinymce.min.js?v=513', function () { window.tinymce.dom.Event.domLoaded = true; tinymce.baseURL = '//' + window.location.host + '/tinymce'; tinymce.suffix = '.min'; @@ -136,6 +144,11 @@ export default Component.extend({ this._super(...arguments); tinymce.EditorManager.execCommand('mceRemoveEditor', true, this.get('editorId')); + + if (this.get('scrollFix')) { + this.set('scrollFix', false); + $('html').css('overflow-y', 'scroll'); + } }, actions: {