summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/chrome/action_manager.js2
-rw-r--r--addons/web/static/src/js/core/dialog.js6
2 files changed, 7 insertions, 1 deletions
diff --git a/addons/web/static/src/js/chrome/action_manager.js b/addons/web/static/src/js/chrome/action_manager.js
index bdcc93e022a..6cb86030fe3 100644
--- a/addons/web/static/src/js/chrome/action_manager.js
+++ b/addons/web/static/src/js/chrome/action_manager.js
@@ -396,7 +396,7 @@ var ActionManager = Widget.extend({
widget.setParent(dialog);
dom.append(dialog.$el, widget.$el, {
in_DOM: true,
- callbacks: [{widget: dialog}, {widget: controller.widget}],
+ callbacks: [{widget: controller.widget}],
});
widget.renderButtons(dialog.$footer);
dialog.rebindButtonBehavior();
diff --git a/addons/web/static/src/js/core/dialog.js b/addons/web/static/src/js/core/dialog.js
index eb567750584..70d92b41386 100644
--- a/addons/web/static/src/js/core/dialog.js
+++ b/addons/web/static/src/js/core/dialog.js
@@ -72,6 +72,9 @@ var Dialog = Widget.extend({
this._opened = new Promise(function (resolve) {
self._openedResolver = resolve;
});
+ if (this.on_attach_callback) {
+ this._opened = this.opened(this.on_attach_callback);
+ }
options = _.defaults(options || {}, {
title: _t('Odoo'), subtitle: '',
size: 'large',
@@ -256,6 +259,9 @@ var Dialog = Widget.extend({
$('.tooltip').remove(); //remove open tooltip if any to prevent them staying when modal has disappeared
if (this.$modal) {
+ if (this.on_detach_callback) {
+ this.on_detach_callback();
+ }
this.$modal.modal('hide');
this.$modal.remove();
}