Merge branch 'MDL-44826-master' of git://github.com/damyon/moodle

This commit is contained in:
Marina Glancy
2014-04-15 17:55:30 +08:00
4 changed files with 31 additions and 6 deletions
@@ -64,7 +64,8 @@ var CSS = {
name: 'text-bottom',
str: 'alignment_bottom',
value: 'vertical-align',
margin: '0 .5em'
margin: '0 .5em',
isDefault: true
},
// Floats.
@@ -426,6 +427,13 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
if (properties === false) {
img.setStyle('display', 'none');
// Set the default alignment.
for (i in ALIGNMENTS) {
if (ALIGNMENTS[i].isDefault === true) {
css = ALIGNMENTS[i].value + ':' + ALIGNMENTS[i].name + ';';
form.one('.' + CSS.INPUTALIGNMENT).set('value', css);
}
}
// Remove the custom style option if this is a new image.
form.one('.' + CSS.INPUTALIGNMENT).getDOMNode().options.remove(ALIGNMENTS.length - 1);
return;
File diff suppressed because one or more lines are too long
@@ -64,7 +64,8 @@ var CSS = {
name: 'text-bottom',
str: 'alignment_bottom',
value: 'vertical-align',
margin: '0 .5em'
margin: '0 .5em',
isDefault: true
},
// Floats.
@@ -426,6 +427,13 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
if (properties === false) {
img.setStyle('display', 'none');
// Set the default alignment.
for (i in ALIGNMENTS) {
if (ALIGNMENTS[i].isDefault === true) {
css = ALIGNMENTS[i].value + ':' + ALIGNMENTS[i].name + ';';
form.one('.' + CSS.INPUTALIGNMENT).set('value', css);
}
}
// Remove the custom style option if this is a new image.
form.one('.' + CSS.INPUTALIGNMENT).getDOMNode().options.remove(ALIGNMENTS.length - 1);
return;
+11 -2
View File
@@ -62,7 +62,8 @@ var CSS = {
name: 'text-bottom',
str: 'alignment_bottom',
value: 'vertical-align',
margin: '0 .5em'
margin: '0 .5em',
isDefault: true
},
// Floats.
@@ -420,10 +421,18 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
*/
_applyImageProperties: function(form) {
var properties = this._getSelectedImageProperties(),
img = form.one('.' + CSS.IMAGEPREVIEW);
img = form.one('.' + CSS.IMAGEPREVIEW),
i;
if (properties === false) {
img.setStyle('display', 'none');
// Set the default alignment.
for (i in ALIGNMENTS) {
if (ALIGNMENTS[i].isDefault === true) {
css = ALIGNMENTS[i].value + ':' + ALIGNMENTS[i].name + ';';
form.one('.' + CSS.INPUTALIGNMENT).set('value', css);
}
}
// Remove the custom style option if this is a new image.
form.one('.' + CSS.INPUTALIGNMENT).getDOMNode().options.remove(ALIGNMENTS.length - 1);
return;