MDL-43259 JavaScript: Deprecate M.core.dialogue's lightbox attribute

The lightbox attribute just sets the modal attribute of the upstream
dialogue and provides no real benefit. We should deprecate it in favour of
documented upstream attributes of Y.Panel.
This commit is contained in:
Andrew Nicols
2013-12-08 16:27:41 +08:00
parent c36a2401ab
commit cff3b8feed
4 changed files with 23 additions and 28 deletions
@@ -79,12 +79,6 @@ DIALOGUE = function(config) {
delete config.width;
}
// lightbox param to keep the stable versions API.
if (config.lightbox !== false) {
config.modal = true;
}
delete config.lightbox;
// closeButton param to keep the stable versions API.
if (config.closeButton === false) {
config.buttons = null;
@@ -387,10 +381,15 @@ Y.extend(DIALOGUE, Y.Panel, {
* @attribute lightbox
* @type Boolean
* @default true
* @deprecated Since Moodle 2.7. Please use modal instead.
*/
lightbox : {
validator : Y.Lang.isBoolean,
value : true
lightbox: {
lazyAdd: false,
setter: function(value) {
Y.log("The lightbox attribute of M.core.dialogue has been deprecated since Moodle 2.7, please use the modal attribute instead",
'warn', 'moodle-core-notification-dialogue');
this.set('modal', value);
}
},
/**
File diff suppressed because one or more lines are too long
@@ -79,12 +79,6 @@ DIALOGUE = function(config) {
delete config.width;
}
// lightbox param to keep the stable versions API.
if (config.lightbox !== false) {
config.modal = true;
}
delete config.lightbox;
// closeButton param to keep the stable versions API.
if (config.closeButton === false) {
config.buttons = null;
@@ -387,10 +381,13 @@ Y.extend(DIALOGUE, Y.Panel, {
* @attribute lightbox
* @type Boolean
* @default true
* @deprecated Since Moodle 2.7. Please use modal instead.
*/
lightbox : {
validator : Y.Lang.isBoolean,
value : true
lightbox: {
lazyAdd: false,
setter: function(value) {
this.set('modal', value);
}
},
/**
+8 -9
View File
@@ -48,12 +48,6 @@ DIALOGUE = function(config) {
delete config.width;
}
// lightbox param to keep the stable versions API.
if (config.lightbox !== false) {
config.modal = true;
}
delete config.lightbox;
// closeButton param to keep the stable versions API.
if (config.closeButton === false) {
config.buttons = null;
@@ -356,10 +350,15 @@ Y.extend(DIALOGUE, Y.Panel, {
* @attribute lightbox
* @type Boolean
* @default true
* @deprecated Since Moodle 2.7. Please use modal instead.
*/
lightbox : {
validator : Y.Lang.isBoolean,
value : true
lightbox: {
lazyAdd: false,
setter: function(value) {
Y.log("The lightbox attribute of M.core.dialogue has been deprecated since Moodle 2.7, please use the modal attribute instead",
'warn', 'moodle-core-notification-dialogue');
this.set('modal', value);
}
},
/**