diff options
| author | qsm-odoo <qsm@odoo.com> | 2015-07-27 13:57:22 +0200 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2015-07-27 13:57:22 +0200 |
| commit | 6d484ad026917addaeb4559ab380f7386ac92898 (patch) | |
| tree | 640eed5fc62c64e174cbc275cfae3f6a5990ee52 /addons/web/static/src/js/framework | |
| parent | e00c33b89e50b4393a8ef892f5f77f4cba249b27 (diff) | |
[IMP] Add Dialog.alert feature
This allows to open a simple message dialog with potential
action when the unique "ok" button is clicked
Diffstat (limited to 'addons/web/static/src/js/framework')
| -rw-r--r-- | addons/web/static/src/js/framework/dialog.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/addons/web/static/src/js/framework/dialog.js b/addons/web/static/src/js/framework/dialog.js index 7053b29bc22..11c936b94f3 100644 --- a/addons/web/static/src/js/framework/dialog.js +++ b/addons/web/static/src/js/framework/dialog.js @@ -145,6 +145,21 @@ var Dialog = Widget.extend({ } }); +// static method to open simple alert dialog +Dialog.alert = function (owner, message, options) { + var buttons = [{ + text: _t("Ok"), + close: true, + click: options && options.confirm_callback, + }]; + return new Dialog(owner, _.extend({ + size: 'medium', + buttons: buttons, + $content: $('<div>', { + text: message, + }), + }, options)).open(); +}; // static method to open simple confirm dialog Dialog.confirm = function (owner, message, options) { |
