(js) Allow to change the labels of Dialog.confirm
This commit is contained in:
parent
9465fbad4b
commit
eb543ce14f
|
@ -31,12 +31,12 @@
|
||||||
* @param {string} content
|
* @param {string} content
|
||||||
* @returns a promise that resolves if the user has clicked on the 'OK' button
|
* @returns a promise that resolves if the user has clicked on the 'OK' button
|
||||||
*/
|
*/
|
||||||
Dialog.confirm = function(title, content) {
|
Dialog.confirm = function(title, content, options) {
|
||||||
var confirm = this.$modal.confirm()
|
var confirm = this.$modal.confirm()
|
||||||
.title(title)
|
.title(title)
|
||||||
.content(content)
|
.content(content)
|
||||||
.ok(l('OK'))
|
.ok((options && options.ok)? options.ok : l('OK'))
|
||||||
.cancel(l('Cancel'));
|
.cancel((options && options.cancel)? options.cancel : l('Cancel'));
|
||||||
return this.$modal.show(confirm);
|
return this.$modal.show(confirm);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,8 @@
|
||||||
}
|
}
|
||||||
function confirmDelete(card) {
|
function confirmDelete(card) {
|
||||||
Dialog.confirm(l('Warning'),
|
Dialog.confirm(l('Warning'),
|
||||||
l('Are you sure you want to delete the card of %{0}?', card.$fullname()))
|
l('Are you sure you want to delete the card of %{0}?', card.$fullname()),
|
||||||
|
{ok: l('Yes'), cancel: l('No')})
|
||||||
.then(function() {
|
.then(function() {
|
||||||
// User confirmed the deletion
|
// User confirmed the deletion
|
||||||
card.$delete()
|
card.$delete()
|
||||||
|
|
Loading…
Reference in a new issue