MDL-43262 JavaScript: Correct use of centered attribute override

This should be done using an attribute modification, rather than at the
constructor level.
This commit is contained in:
Andrew Nicols
2014-01-13 08:26:28 +13:00
committed by Sam Hemelryk
parent c46cca4f94
commit a67233e76f
4 changed files with 61 additions and 7 deletions
@@ -70,8 +70,6 @@ DIALOGUE = function(c) {
}
config.srcNode = '#'+id;
config.center = config.centered && true;
config.centered = false;
config.COUNT = COUNT;
// closeButton param to keep the stable versions API.
@@ -508,6 +506,26 @@ Y.Base.modifyAttrs(DIALOGUE, {
*/
visible: {
value: false
},
/**
* A convenience Attribute, which can be used as a shortcut for the
* `align` Attribute.
*
* Note: We override this in Moodle such that it sets a value for the
* `center` attribute if set. The `centered` will always return false.
*
* @attribute centered
* @type Boolean|Node
* @default false
*/
centered: {
setter: function(value) {
if (value) {
this.set('center', true);
}
return false;
}
}
});
File diff suppressed because one or more lines are too long
@@ -70,8 +70,6 @@ DIALOGUE = function(c) {
}
config.srcNode = '#'+id;
config.center = config.centered && true;
config.centered = false;
config.COUNT = COUNT;
// closeButton param to keep the stable versions API.
@@ -506,6 +504,26 @@ Y.Base.modifyAttrs(DIALOGUE, {
*/
visible: {
value: false
},
/**
* A convenience Attribute, which can be used as a shortcut for the
* `align` Attribute.
*
* Note: We override this in Moodle such that it sets a value for the
* `center` attribute if set. The `centered` will always return false.
*
* @attribute centered
* @type Boolean|Node
* @default false
*/
centered: {
setter: function(value) {
if (value) {
this.set('center', true);
}
return false;
}
}
});
+20 -2
View File
@@ -39,8 +39,6 @@ DIALOGUE = function(c) {
}
config.srcNode = '#'+id;
config.center = config.centered && true;
config.centered = false;
config.COUNT = COUNT;
// closeButton param to keep the stable versions API.
@@ -477,6 +475,26 @@ Y.Base.modifyAttrs(DIALOGUE, {
*/
visible: {
value: false
},
/**
* A convenience Attribute, which can be used as a shortcut for the
* `align` Attribute.
*
* Note: We override this in Moodle such that it sets a value for the
* `center` attribute if set. The `centered` will always return false.
*
* @attribute centered
* @type Boolean|Node
* @default false
*/
centered: {
setter: function(value) {
if (value) {
this.set('center', true);
}
return false;
}
}
});