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:
Jake Dallimore
2017-03-17 09:05:04 +08:00
parent 98c4094eac
commit 3d4339b817
4 changed files with 8 additions and 8 deletions
@@ -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;
File diff suppressed because one or more lines are too long
@@ -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
View File
@@ -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;