From ed008c284b58c5e7f635f34299bca747b529cc17 Mon Sep 17 00:00:00 2001 From: AIC BV <89913092+AIC-BV@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:40:00 +0200 Subject: [PATCH] Add multilingual new css layout support https://github.com/wintercms/wn-translate-plugin/pull/73 --- .../markdowneditor/assets/js/markdowneditor.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/backend/formwidgets/markdowneditor/assets/js/markdowneditor.js b/modules/backend/formwidgets/markdowneditor/assets/js/markdowneditor.js index 3e8cc9b1a0..503a2784d1 100644 --- a/modules/backend/formwidgets/markdowneditor/assets/js/markdowneditor.js +++ b/modules/backend/formwidgets/markdowneditor/assets/js/markdowneditor.js @@ -571,9 +571,12 @@ this.setFullscreen(!this.isFullscreen) if (this.isPreview) { this.togglePreview() + } else { + this.setMLButton() } this.editor.focus() + $('[data-button-code="fullscreen"]', this.$toolbar).toggleClass('active') } @@ -585,6 +588,7 @@ } else { this.editor.focus() + this.setMLButton() } this.$el.toggleClass('is-preview', this.isPreview) @@ -593,6 +597,13 @@ $('[data-button-code="preview"]', this.$toolbar).toggleClass('active') } + MarkdownEditor.prototype.setMLButton = function() { + if (this.$el.attr('id').substr(0, 2) === 'ML') { + var input = this.$el.find('.ace_text-input') + if (input) setTimeout(function() { input.keyup() }, 0) + } + } + MarkdownEditor.prototype.insertLine = function(template) { var editor = this.editor, pos = this.editor.getCursorPosition()