[FIX]modal close function in kanban and edi

This commit is contained in:
Cedric Snauwaert 2014-06-02 16:41:58 +02:00
parent c319dc40e7
commit 772a5d6b75
2 changed files with 16 additions and 18 deletions

View File

@ -39,16 +39,15 @@ instance.edi.EdiImport = instance.web.Widget.extend({
}); });
} }
else { else {
$('<div>').dialog({ new instance.web.Dialog(this,{
modal: true, title: 'Import Successful!',
title: 'Import Successful!', buttons: {
buttons: { Ok: function() {
Ok: function() { this.parents('.modal').modal('hide');
$(this).dialog("close"); window.location = "/";
window.location = "/"; }
} }
} },$('<div>').html(_t('The document has been successfully imported!'))).open();
}).html(_t('The document has been successfully imported!'));
} }
}, },
on_imported_error: function(response){ on_imported_error: function(response){
@ -58,13 +57,12 @@ instance.edi.EdiImport = instance.web.Widget.extend({
msg += "\n " + _t("Reason:") + response.data.message; msg += "\n " + _t("Reason:") + response.data.message;
} }
var params = {error: response, message: msg}; var params = {error: response, message: msg};
$(instance.web.qweb.render("CrashManager.warning", params)).dialog({ new instance.web.Dialog(this,{
title: _t("Document Import Notification"), title: _t("Document Import Notification"),
modal: true, buttons: {
buttons: { Ok: function() { this.parents('.modal').modal('hide');}
Ok: function() { $(this).dialog("close"); } }
} },$(instance.web.qweb.render("CrashManager.warning", params))).open();
});
} }
}); });

View File

@ -779,9 +779,9 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
}); });
var am = instance.webclient.action_manager; var am = instance.webclient.action_manager;
var form = am.dialog_widget.views.form.controller; var form = am.dialog_widget.views.form.controller;
form.on("on_button_cancel", am.dialog, am.dialog.close); form.on("on_button_cancel", am.dialog, function() { return am.dialog.$dialog_box.modal('hide'); });
form.on('record_saved', self, function() { form.on('record_saved', self, function() {
am.dialog.close(); am.dialog.$dialog_box.modal('hide');
self.view.do_reload(); self.view.do_reload();
}); });
}, },