mirror of
https://github.com/moodle/moodle.git
synced 2025-03-07 09:21:10 +01:00
MDL-43262 JavaScript: Correct width attribute override
This should be done using an attribute modification, rather than at the constructor level.
This commit is contained in:
parent
12efa52762
commit
16d024348a
@ -70,15 +70,11 @@ DIALOGUE = function(c) {
|
||||
}
|
||||
|
||||
config.srcNode = '#'+id;
|
||||
config.width = config.width || '400px';
|
||||
config.visible = config.visible || false;
|
||||
config.center = config.centered && true;
|
||||
config.centered = false;
|
||||
config.COUNT = COUNT;
|
||||
|
||||
if (config.width === 'auto') {
|
||||
delete config.width;
|
||||
}
|
||||
|
||||
// closeButton param to keep the stable versions API.
|
||||
if (config.closeButton === false) {
|
||||
config.buttons = null;
|
||||
@ -479,6 +475,30 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
}
|
||||
});
|
||||
|
||||
Y.Base.modifyAttrs(DIALOGUE, {
|
||||
/**
|
||||
* String with units, or number, representing the width of the Widget.
|
||||
* If a number is provided, the default unit, defined by the Widgets
|
||||
* DEF_UNIT, property is used.
|
||||
*
|
||||
* If a value of 'auto' is used, then an empty String is instead
|
||||
* returned.
|
||||
*
|
||||
* @attribute width
|
||||
* @default '400px'
|
||||
* @type {String|Number}
|
||||
*/
|
||||
width: {
|
||||
value: '400px',
|
||||
setter: function(value) {
|
||||
if (value === 'auto') {
|
||||
return '';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
M.core.dialogue = DIALOGUE;
|
||||
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -70,15 +70,11 @@ DIALOGUE = function(c) {
|
||||
}
|
||||
|
||||
config.srcNode = '#'+id;
|
||||
config.width = config.width || '400px';
|
||||
config.visible = config.visible || false;
|
||||
config.center = config.centered && true;
|
||||
config.centered = false;
|
||||
config.COUNT = COUNT;
|
||||
|
||||
if (config.width === 'auto') {
|
||||
delete config.width;
|
||||
}
|
||||
|
||||
// closeButton param to keep the stable versions API.
|
||||
if (config.closeButton === false) {
|
||||
config.buttons = null;
|
||||
@ -477,6 +473,30 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
}
|
||||
});
|
||||
|
||||
Y.Base.modifyAttrs(DIALOGUE, {
|
||||
/**
|
||||
* String with units, or number, representing the width of the Widget.
|
||||
* If a number is provided, the default unit, defined by the Widgets
|
||||
* DEF_UNIT, property is used.
|
||||
*
|
||||
* If a value of 'auto' is used, then an empty String is instead
|
||||
* returned.
|
||||
*
|
||||
* @attribute width
|
||||
* @default '400px'
|
||||
* @type {String|Number}
|
||||
*/
|
||||
width: {
|
||||
value: '400px',
|
||||
setter: function(value) {
|
||||
if (value === 'auto') {
|
||||
return '';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
M.core.dialogue = DIALOGUE;
|
||||
|
||||
|
||||
|
30
lib/yui/src/notification/js/dialogue.js
vendored
30
lib/yui/src/notification/js/dialogue.js
vendored
@ -39,15 +39,11 @@ DIALOGUE = function(c) {
|
||||
}
|
||||
|
||||
config.srcNode = '#'+id;
|
||||
config.width = config.width || '400px';
|
||||
config.visible = config.visible || false;
|
||||
config.center = config.centered && true;
|
||||
config.centered = false;
|
||||
config.COUNT = COUNT;
|
||||
|
||||
if (config.width === 'auto') {
|
||||
delete config.width;
|
||||
}
|
||||
|
||||
// closeButton param to keep the stable versions API.
|
||||
if (config.closeButton === false) {
|
||||
config.buttons = null;
|
||||
@ -448,4 +444,28 @@ Y.extend(DIALOGUE, Y.Panel, {
|
||||
}
|
||||
});
|
||||
|
||||
Y.Base.modifyAttrs(DIALOGUE, {
|
||||
/**
|
||||
* String with units, or number, representing the width of the Widget.
|
||||
* If a number is provided, the default unit, defined by the Widgets
|
||||
* DEF_UNIT, property is used.
|
||||
*
|
||||
* If a value of 'auto' is used, then an empty String is instead
|
||||
* returned.
|
||||
*
|
||||
* @attribute width
|
||||
* @default '400px'
|
||||
* @type {String|Number}
|
||||
*/
|
||||
width: {
|
||||
value: '400px',
|
||||
setter: function(value) {
|
||||
if (value === 'auto') {
|
||||
return '';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
M.core.dialogue = DIALOGUE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user