From 3a511aaa700bc9965cd6967b2b8fb1b21ccdce8d Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Tue, 30 Jun 2015 14:34:45 +0200 Subject: [IMP] web,web_kanban: Dialog.confirm api takes now an object of options for the Dialog, containing two possible callbacks (for confirm and cancel). --- addons/web/static/src/js/framework/dialog.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'addons/web/static/src/js/framework') diff --git a/addons/web/static/src/js/framework/dialog.js b/addons/web/static/src/js/framework/dialog.js index 45a00bcaa60..7053b29bc22 100644 --- a/addons/web/static/src/js/framework/dialog.js +++ b/addons/web/static/src/js/framework/dialog.js @@ -147,24 +147,28 @@ var Dialog = Widget.extend({ // static method to open simple confirm dialog -Dialog.confirm = function (owner, message, confirm_callback) { +Dialog.confirm = function (owner, message, options) { var buttons = [ { text: _t("Ok"), classes: 'btn-primary', close: true, - click: confirm_callback + click: options && options.confirm_callback }, - {text: _t("Cancel"), close: true} + { + text: _t("Cancel"), + close: true, + click: options && options.cancel_callback + } ]; - return new Dialog(owner, { + return new Dialog(owner, _.extend({ size: 'medium', buttons: buttons, $content: $('
', { text: message, }), - }).open(); -} + }, options)).open(); +}; return Dialog; -- cgit v1.2.3