[IMP] Improved on close code.
bzr revid: vta@openerp.com-20121012130254-kthondab91jph64x
This commit is contained in:
parent
d0c88ce9cb
commit
48118a7afe
|
@ -70,7 +70,7 @@ instance.web.Dialog = instance.web.Widget.extend({
|
||||||
autoOpen: false,
|
autoOpen: false,
|
||||||
position: [false, 40],
|
position: [false, 40],
|
||||||
buttons: {},
|
buttons: {},
|
||||||
beforeClose: function () { self.on_close(); },
|
beforeClose: function () { self.close(); },
|
||||||
resizeStop: this.on_resized
|
resizeStop: this.on_resized
|
||||||
};
|
};
|
||||||
for (var f in this) {
|
for (var f in this) {
|
||||||
|
@ -150,17 +150,14 @@ instance.web.Dialog = instance.web.Widget.extend({
|
||||||
var res = this.start();
|
var res = this.start();
|
||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
this.$el.dialog('close');
|
|
||||||
},
|
|
||||||
on_close: function() {
|
|
||||||
this.trigger("dialog_close");
|
|
||||||
if (this.__tmp_dialog_destroying)
|
if (this.__tmp_dialog_destroying)
|
||||||
return;
|
return;
|
||||||
if (this.dialog_options.destroy_on_close) {
|
if (this.dialog_options.destroy_on_close) {
|
||||||
this.__tmp_dialog_closing = true;
|
this.__tmp_dialog_closing = true;
|
||||||
this.destroy();
|
this.destroy();
|
||||||
this.__tmp_dialog_closing = undefined;
|
this.__tmp_dialog_closing = undefined;
|
||||||
|
this.trigger("dialog_close");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
on_resized: function() {
|
on_resized: function() {
|
||||||
|
|
|
@ -286,8 +286,9 @@ instance.web.ActionManager = instance.web.Widget.extend({
|
||||||
buttons: { "Close": function() { $(this).dialog("close"); }},
|
buttons: { "Close": function() { $(this).dialog("close"); }},
|
||||||
dialogClass: executor.klass
|
dialogClass: executor.klass
|
||||||
});
|
});
|
||||||
if(on_close)
|
if (on_close) {
|
||||||
this.dialog.on("dialog_close",this,on_close);
|
this.dialog.on("dialog_close", this, on_close);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.dialog_widget.destroy();
|
this.dialog_widget.destroy();
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,6 @@ instance.web_view_editor.ViewEditor = instance.web.Widget.extend({
|
||||||
{text: _t("Close"), click: function() { self.view_edit_dialog.close(); window.location.reload(); }}
|
{text: _t("Close"), click: function() { self.view_edit_dialog.close(); window.location.reload(); }}
|
||||||
]
|
]
|
||||||
}).open();
|
}).open();
|
||||||
this.view_edit_dialog.on("dialog_close", self, function(){window.location.reload();});
|
|
||||||
this.main_view_id = this.parent.fields_view.view_id;
|
this.main_view_id = this.parent.fields_view.view_id;
|
||||||
this.action_manager = new instance.web.ActionManager(this);
|
this.action_manager = new instance.web.ActionManager(this);
|
||||||
this.action_manager.appendTo(this.view_edit_dialog.$el);
|
this.action_manager.appendTo(this.view_edit_dialog.$el);
|
||||||
|
|
Loading…
Reference in New Issue