summaryrefslogtreecommitdiff
path: root/addons/web/static
diff options
context:
space:
mode:
authorniv-openerp <nicolas.vanhoren@openerp.com>2013-03-01 15:00:15 +0100
committerniv-openerp <nicolas.vanhoren@openerp.com>2013-03-01 15:00:15 +0100
commit36d47aebc1ba6f8c70fa0eaeb03e75b6989e2cc0 (patch)
tree6cd32809cb35331892d8282a7d04802b2aaae118 /addons/web/static
parentde3312164435c82f94ca5e759f608dad8fd99ea6 (diff)
[FIX] small problem with <button confirm="..."/>, didn't confirmed correctly when closing the popup
lp bug: https://launchpad.net/bugs/1095366 fixed bzr revid: nicolas.vanhoren@openerp.com-20130301140015-67av4zwrdhbh3srh
Diffstat (limited to 'addons/web/static')
-rw-r--r--addons/web/static/src/js/view_form.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index db67b1793b8..479d091d4db 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -1916,18 +1916,20 @@ instance.web.form.WidgetButton = instance.web.form.FormWidget.extend({
modal: true,
buttons: [
{text: _t("Cancel"), click: function() {
- def.resolve();
$(this).dialog("close");
}
},
{text: _t("Ok"), click: function() {
- self.on_confirmed().done(function() {
- def.resolve();
+ var self2 = this;
+ self.on_confirmed().always(function() {
+ $(self2).dialog("close");
});
- $(this).dialog("close");
}
- }
- ]
+ },
+ ],
+ beforeClose: function() {
+ def.resolve();
+ },
});
return def.promise();
} else {