mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-45227 atto_align: Make IE follow css styling
This commit is contained in:
parent
31d62654a6
commit
613c130665
@ -83,6 +83,15 @@ Y.namespace('M.atto_align').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
|
||||
document.execCommand(justification, false, null);
|
||||
|
||||
// To clean up IE's mess.
|
||||
this.editor.all('*[align]').each(function(node) {
|
||||
var align = node.get('align');
|
||||
if (align) {
|
||||
node.setStyle('text-align', align);
|
||||
node.removeAttribute('align');
|
||||
}
|
||||
}, this);
|
||||
|
||||
// Re-disable the CSS styling after making the change.
|
||||
host.disableCssStyling();
|
||||
|
||||
|
@ -1 +1 @@
|
||||
YUI.add("moodle-atto_align-button",function(e,t){e.namespace("M.atto_align").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){var e;e="justifyLeft",this.addButton({icon:"e/align_left",title:"leftalign",buttonName:e,callback:this._changeStyle,callbackArgs:e}),e="justifyCenter",this.addButton({icon:"e/align_center",title:"center",buttonName:e,callback:this._changeStyle,callbackArgs:e}),e="justifyRight",this.addButton({icon:"e/align_right",title:"rightalign",buttonName:e,callback:this._changeStyle,callbackArgs:e})},_changeStyle:function(e,t){var n=this.get("host");n.enableCssStyling(),document.execCommand(t,!1,null),n.disableCssStyling(),this.markUpdated(),this.editor.focus()}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});
|
||||
YUI.add("moodle-atto_align-button",function(e,t){e.namespace("M.atto_align").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){var e;e="justifyLeft",this.addButton({icon:"e/align_left",title:"leftalign",buttonName:e,callback:this._changeStyle,callbackArgs:e}),e="justifyCenter",this.addButton({icon:"e/align_center",title:"center",buttonName:e,callback:this._changeStyle,callbackArgs:e}),e="justifyRight",this.addButton({icon:"e/align_right",title:"rightalign",buttonName:e,callback:this._changeStyle,callbackArgs:e})},_changeStyle:function(e,t){var n=this.get("host");n.enableCssStyling(),document.execCommand(t,!1,null),this.editor.all("*[align]").each(function(e){var t=e.get("align");t&&(e.setStyle("text-align",t),e.removeAttribute("align"))},this),n.disableCssStyling(),this.markUpdated(),this.editor.focus()}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});
|
||||
|
@ -83,6 +83,15 @@ Y.namespace('M.atto_align').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
|
||||
document.execCommand(justification, false, null);
|
||||
|
||||
// To clean up IE's mess.
|
||||
this.editor.all('*[align]').each(function(node) {
|
||||
var align = node.get('align');
|
||||
if (align) {
|
||||
node.setStyle('text-align', align);
|
||||
node.removeAttribute('align');
|
||||
}
|
||||
}, this);
|
||||
|
||||
// Re-disable the CSS styling after making the change.
|
||||
host.disableCssStyling();
|
||||
|
||||
|
@ -81,6 +81,15 @@ Y.namespace('M.atto_align').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
|
||||
document.execCommand(justification, false, null);
|
||||
|
||||
// To clean up IE's mess.
|
||||
this.editor.all('*[align]').each(function(node) {
|
||||
var align = node.get('align');
|
||||
if (align) {
|
||||
node.setStyle('text-align', align);
|
||||
node.removeAttribute('align');
|
||||
}
|
||||
}, this);
|
||||
|
||||
// Re-disable the CSS styling after making the change.
|
||||
host.disableCssStyling();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user