Skip to content

Instantly share code, notes, and snippets.

@andrewnicols
Last active December 28, 2015 04:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save andrewnicols/dbfe7d2b4f66921ca1ba to your computer and use it in GitHub Desktop.
/**
* The button text to use to accept the alert.
*
* @attribute yesLabel
* @type String
* @default 'Ok'
*/
yesLabel : {
validator : Y.Lang.isString,
setter : function(txt) {
if (!txt) {
txt = 'Ok';
}
return txt;
},
value : 'Ok'
}
/**
* The button text to use to accept the alert.
*
* @attribute yesLabel
* @type Object
* @default {
* identifier: 'ok',
* component: 'moodle
* }
}
*/
yesLabel : {
value : {
identifier: 'ok',
component: 'moodle'
}
getter: function(value) {
if (typeof value === 'object') {
return M.util.get_string(
value.identifier || 'ok',
value.component || 'moodle'
);
} else {
Y.log("Found a deprecated yesLabel value of '" + value "'", 'warn', 'moodle-core-notification-alert');
return value;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment