MDL-51177 atto_html: Check isHTML before hiding editor
authorAndrew Nicols <andrew@nicols.co.uk>
Thu, 13 Sep 2018 07:32:20 +0000 (15:32 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Thu, 13 Sep 2018 07:38:14 +0000 (15:38 +0800)
lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button-debug.js
lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button-min.js
lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button.js
lib/editor/atto/plugins/html/yui/src/button/js/button.js

index 40df031..a3d932a 100644 (file)
Binary files a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button-debug.js and b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button-debug.js differ
index 540f08a..4405900 100644 (file)
Binary files a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button-min.js and b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button-min.js differ
index 40df031..a3d932a 100644 (file)
Binary files a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button.js and b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button.js differ
index caf5b23..c3a180c 100644 (file)
@@ -45,7 +45,11 @@ Y.namespace('M.atto_html').Button = Y.Base.create('button', Y.M.editor_atto.Edit
         // This ensures that the codeMirror is converted back to the original text before form submission.
         var form = this.get('host').textarea.ancestor('form');
         if (form) {
-            form.on('submit', this._hideCodeMirror, this);
+            form.on('submit', function() {
+                if (this.get('isHTML')) {
+                    this._hideCodeMirror();
+                }
+            }, this);
         }
     },