MDL-28195 confirm_action should allow the button labels to be customised

This commit is contained in:
Tim Hunt
2011-07-11 15:03:39 +08:00
committed by Sam Hemelryk
parent a8361fc214
commit c159d8e872
3 changed files with 16 additions and 5 deletions
+11 -2
View File
@@ -275,8 +275,17 @@ M.util.show_confirm_dialog = function(e, args) {
}
};
var buttons = [ {text: M.str.moodle.cancel, handler: handle_cancel, isDefault: true},
{text: M.str.moodle.yes, handler: handle_yes} ];
if (!args.cancellabel) {
args.cancellabel = M.str.moodle.cancel;
}
if (!args.continuelabel) {
args.continuelabel = M.str.moodle.yes;
}
var buttons = [
{text: args.cancellabel, handler: handle_cancel, isDefault: true},
{text: args.continuelabel, handler: handle_yes}
];
simpledialog.cfg.queueProperty('buttons', buttons);