]> BookStack Code Mirror - bookstack/commitdiff
Removed unused scroll patch after testing
authorDan Brown <redacted>
Tue, 8 Feb 2022 09:42:18 +0000 (09:42 +0000)
committerDan Brown <redacted>
Tue, 8 Feb 2022 09:42:18 +0000 (09:42 +0000)
- Tested on android and ios
- Also checked on translations and removed todo.

resources/js/wysiwyg/config.js
resources/js/wysiwyg/drop-paste-handling.js
resources/js/wysiwyg/scrolling.js

index 0b43b9c79bc306af492986732b972f2c4283b9a8..2c9fb0553971d49eae1c1dae55c83f405133cfa3 100644 (file)
@@ -1,6 +1,6 @@
 import {register as registerShortcuts} from "./shortcuts";
 import {listen as listenForCommonEvents} from "./common-events";
-import {scrollToQueryString, fixScrollForMobile} from "./scrolling";
+import {scrollToQueryString} from "./scrolling";
 import {listenForDragAndPaste} from "./drop-paste-handling";
 
 import {getPlugin as getCodeeditorPlugin} from "./plugin-codeeditor";
@@ -164,7 +164,6 @@ function getSetupCallback(options) {
         editor.on('init', () => {
             editorChange();
             scrollToQueryString(editor);
-            fixScrollForMobile(editor);
             window.editor = editor;
         });
 
index 1da13c88835dcd0a4d1f24e644289ddb9c019792..ace74dd334e03c8a17bcfbf527ae3d178ac44295 100644 (file)
@@ -43,7 +43,6 @@ function paste(editor, options, event) {
                 editor.dom.replace(newEl, id);
             }).catch(err => {
                 editor.dom.remove(id);
-                // TODO - Check we have this translation
                 window.$events.emit('error', options.translations.imageUploadErrorText);
                 console.log(err);
             });
index 360d1838149fb731c176b72f97b2a9aec4cabc2d..f14ef4c643abe778c24e96ca0974aa8e4265bfb0 100644 (file)
@@ -11,21 +11,6 @@ export function scrollToQueryString(editor) {
     }
 }
 
-/**
- * Override for touch events to allow scrolling on mobile devices.
- * TODO - Check if still needed or if needs editing.
- * @param {Editor} editor
- */
-export function fixScrollForMobile(editor) {
-    const container = editor.getContainer();
-    const toolbarButtons = container.querySelectorAll('.mce-btn');
-    for (let button of toolbarButtons) {
-        button.addEventListener('touchstart', event => {
-            event.stopPropagation();
-        });
-    }
-}
-
 /**
  * @param {Editor} editor
  * @param {String} scrollId