-
Notifications
You must be signed in to change notification settings - Fork 1
Prompts
Beecher edited this page Sep 29, 2015
·
3 revisions
-
Based on the
window.confirmmethod, but with greater styling and functional possibilities. -
We're using a
"yarp/narp"convention instead of"confirm/cancel". -
Specify button text like (defaults to 'confirm' and 'cancel'):
var confrimArgs = {
yarp : {
text: "the confirm button text",
disabled: true // optional
},
narp : {
text: { // if you want translations
"en" : "cancel in english",
"es" : "como se dice, 'cancel'?"
}
}
};
// then you'd pass it to the show method like
_mb.show({
body: "whatever?",
confirm: confrimArgs
});- Specify functionality within the callbacks 'yarp' and 'narp' :
var confirmAction = function(_mb) {
// whatver you want, really ...
},
cancelAction = function(_mb) {
// whatver you want, really ...
};
_mb.show({
body: "whatever?",
callbacks: {
yarp : confirmAction,
narp : cancelAction
}
});