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:
committed by
Sam Hemelryk
parent
c46cca4f94
commit
a67233e76f
+20
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+20
-2
@@ -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
@@ -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;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user