+ editor.on('ExecCommand change input NodeChange ObjectResized', editorChange);
+
+ editor.on('init', () => {
+ editorChange();
+ // Scroll to the content if needed.
+ const queryParams = (new URL(window.location)).searchParams;
+ const scrollId = queryParams.get('content-id');
+ if (scrollId) {
+ scrollToText(scrollId);
+ }
+
+ // Override for touch events to allow scroll on mobile
+ const container = editor.getContainer();
+ const toolbarButtons = container.querySelectorAll('.mce-btn');
+ for (let button of toolbarButtons) {
+ button.addEventListener('touchstart', event => {
+ event.stopPropagation();
+ });
+ }
+ window.editor = editor;
+ });