MDL-58182 javascript: Fix for buttons regression in core dialog.
Fixes a regression caused by MDL-56364, wherein the buttons were made readOnly, meaning addButtons wouldn't work. This removes that change, while maintaining the original dependency between the buttons and the closeButton config options.
This commit is contained in:
+2
-2
@@ -72,6 +72,7 @@ DIALOGUE = function(config) {
|
||||
.append(Y.Node.create('<div class="' + CSS.FOOTER + ' yui3-widget-ft"></div>')));
|
||||
Y.one(document.body).append(config.notificationBase);
|
||||
config.srcNode = '#' + id;
|
||||
delete config.buttons; // Don't let anyone pass in buttons as we want to control these during init. addButton can be used later.
|
||||
DIALOGUE.superclass.constructor.apply(this, [config]);
|
||||
};
|
||||
Y.extend(DIALOGUE, Y.Panel, {
|
||||
@@ -778,9 +779,8 @@ Y.Base.modifyAttrs(DIALOGUE, {
|
||||
* @default {}
|
||||
*/
|
||||
buttons: {
|
||||
// Readonly is really important. We don't want to allow users of the plugin to pass in buttons. closeButton handles this.
|
||||
readOnly: true,
|
||||
getter: Y.WidgetButtons.prototype._getButtons,
|
||||
setter: Y.WidgetButtons.prototype._setButtons,
|
||||
valueFn: function() {
|
||||
if (this.get('closeButton') === false) {
|
||||
return null;
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+2
-2
@@ -72,6 +72,7 @@ DIALOGUE = function(config) {
|
||||
.append(Y.Node.create('<div class="' + CSS.FOOTER + ' yui3-widget-ft"></div>')));
|
||||
Y.one(document.body).append(config.notificationBase);
|
||||
config.srcNode = '#' + id;
|
||||
delete config.buttons; // Don't let anyone pass in buttons as we want to control these during init. addButton can be used later.
|
||||
DIALOGUE.superclass.constructor.apply(this, [config]);
|
||||
};
|
||||
Y.extend(DIALOGUE, Y.Panel, {
|
||||
@@ -775,9 +776,8 @@ Y.Base.modifyAttrs(DIALOGUE, {
|
||||
* @default {}
|
||||
*/
|
||||
buttons: {
|
||||
// Readonly is really important. We don't want to allow users of the plugin to pass in buttons. closeButton handles this.
|
||||
readOnly: true,
|
||||
getter: Y.WidgetButtons.prototype._getButtons,
|
||||
setter: Y.WidgetButtons.prototype._setButtons,
|
||||
valueFn: function() {
|
||||
if (this.get('closeButton') === false) {
|
||||
return null;
|
||||
|
||||
+2
-2
@@ -42,6 +42,7 @@ DIALOGUE = function(config) {
|
||||
.append(Y.Node.create('<div class="' + CSS.FOOTER + ' yui3-widget-ft"></div>')));
|
||||
Y.one(document.body).append(config.notificationBase);
|
||||
config.srcNode = '#' + id;
|
||||
delete config.buttons; // Don't let anyone pass in buttons as we want to control these during init. addButton can be used later.
|
||||
DIALOGUE.superclass.constructor.apply(this, [config]);
|
||||
};
|
||||
Y.extend(DIALOGUE, Y.Panel, {
|
||||
@@ -748,9 +749,8 @@ Y.Base.modifyAttrs(DIALOGUE, {
|
||||
* @default {}
|
||||
*/
|
||||
buttons: {
|
||||
// Readonly is really important. We don't want to allow users of the plugin to pass in buttons. closeButton handles this.
|
||||
readOnly: true,
|
||||
getter: Y.WidgetButtons.prototype._getButtons,
|
||||
setter: Y.WidgetButtons.prototype._setButtons,
|
||||
valueFn: function() {
|
||||
if (this.get('closeButton') === false) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user