diff --git a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button-debug.js b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button-debug.js index 913233edd9a..8e19cb21a61 100644 --- a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button-debug.js +++ b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button-debug.js @@ -97,10 +97,19 @@ Y.namespace('M.atto_html').Button = Y.Base.create('button', Y.M.editor_atto.Edit // Copy the text to the contenteditable div. host.updateOriginal(); + // Get the width, padding, and margin of the editor. + host.textarea.setStyles({ + 'width': this.editor.getComputedStyle('width'), + 'height': this.editor.getComputedStyle('height'), + 'margin': this.editor.getComputedStyle('margin'), + 'padding': this.editor.getComputedStyle('padding') + }); + // Hide the editor, and show the textarea. this.editor.hide(); host.textarea.show(); + // Focus on the textarea. host.textarea.focus(); } diff --git a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button-min.js b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button-min.js index 7c477c47c49..0b9d2ea5299 100644 --- a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button-min.js +++ b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button-min.js @@ -1 +1 @@ -YUI.add("moodle-atto_html-button",function(e,t){e.namespace("M.atto_html").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){this.addButton({icon:"e/source_code",callback:this._toggleHTML})},_toggleHTML:function(){this.set("isHTML",!this.get("isHTML")),this._showHTML()},_showHTML:function(){var e=this.get("host");this.get("isHTML")?(this.highlightButtons("html"),e.disablePlugins(),e.enablePlugins(this.name),e.updateOriginal(),this.editor.hide(),e.textarea.show(),e.textarea.focus()):(this.unHighlightButtons("html"),e.enablePlugins(),e.updateFromTextArea(),e.textarea.hide(),this.editor.show(),e.focus(),this.markUpdated())}},{ATTRS:{isHTML:{value:!1}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin","event-valuechange"]}); +YUI.add("moodle-atto_html-button",function(e,t){e.namespace("M.atto_html").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){this.addButton({icon:"e/source_code",callback:this._toggleHTML})},_toggleHTML:function(){this.set("isHTML",!this.get("isHTML")),this._showHTML()},_showHTML:function(){var e=this.get("host");this.get("isHTML")?(this.highlightButtons("html"),e.disablePlugins(),e.enablePlugins(this.name),e.updateOriginal(),e.textarea.setStyles({width:this.editor.getComputedStyle("width"),height:this.editor.getComputedStyle("height"),margin:this.editor.getComputedStyle("margin"),padding:this.editor.getComputedStyle("padding")}),this.editor.hide(),e.textarea.show(),e.textarea.focus()):(this.unHighlightButtons("html"),e.enablePlugins(),e.updateFromTextArea(),e.textarea.hide(),this.editor.show(),e.focus(),this.markUpdated())}},{ATTRS:{isHTML:{value:!1}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin","event-valuechange"]}); diff --git a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button.js b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button.js index 913233edd9a..8e19cb21a61 100644 --- a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button.js +++ b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-button/moodle-atto_html-button.js @@ -97,10 +97,19 @@ Y.namespace('M.atto_html').Button = Y.Base.create('button', Y.M.editor_atto.Edit // Copy the text to the contenteditable div. host.updateOriginal(); + // Get the width, padding, and margin of the editor. + host.textarea.setStyles({ + 'width': this.editor.getComputedStyle('width'), + 'height': this.editor.getComputedStyle('height'), + 'margin': this.editor.getComputedStyle('margin'), + 'padding': this.editor.getComputedStyle('padding') + }); + // Hide the editor, and show the textarea. this.editor.hide(); host.textarea.show(); + // Focus on the textarea. host.textarea.focus(); } diff --git a/lib/editor/atto/plugins/html/yui/src/button/js/button.js b/lib/editor/atto/plugins/html/yui/src/button/js/button.js index 7df91aeff09..9c65d866ad0 100644 --- a/lib/editor/atto/plugins/html/yui/src/button/js/button.js +++ b/lib/editor/atto/plugins/html/yui/src/button/js/button.js @@ -95,10 +95,19 @@ Y.namespace('M.atto_html').Button = Y.Base.create('button', Y.M.editor_atto.Edit // Copy the text to the contenteditable div. host.updateOriginal(); + // Get the width, padding, and margin of the editor. + host.textarea.setStyles({ + 'width': this.editor.getComputedStyle('width'), + 'height': this.editor.getComputedStyle('height'), + 'margin': this.editor.getComputedStyle('margin'), + 'padding': this.editor.getComputedStyle('padding') + }); + // Hide the editor, and show the textarea. this.editor.hide(); host.textarea.show(); + // Focus on the textarea. host.textarea.focus(); }