Skip to content

Commit 772a5d6

Browse files
committed
[FIX]modal close function in kanban and edi
1 parent c319dc4 commit 772a5d6

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

addons/edi/static/src/js/edi.js

+14-16
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,15 @@ instance.edi.EdiImport = instance.web.Widget.extend({
3939
});
4040
}
4141
else {
42-
$('<div>').dialog({
43-
modal: true,
44-
title: 'Import Successful!',
45-
buttons: {
46-
Ok: function() {
47-
$(this).dialog("close");
48-
window.location = "/";
42+
new instance.web.Dialog(this,{
43+
title: 'Import Successful!',
44+
buttons: {
45+
Ok: function() {
46+
this.parents('.modal').modal('hide');
47+
window.location = "/";
48+
}
4949
}
50-
}
51-
}).html(_t('The document has been successfully imported!'));
50+
},$('<div>').html(_t('The document has been successfully imported!'))).open();
5251
}
5352
},
5453
on_imported_error: function(response){
@@ -58,13 +57,12 @@ instance.edi.EdiImport = instance.web.Widget.extend({
5857
msg += "\n " + _t("Reason:") + response.data.message;
5958
}
6059
var params = {error: response, message: msg};
61-
$(instance.web.qweb.render("CrashManager.warning", params)).dialog({
62-
title: _t("Document Import Notification"),
63-
modal: true,
64-
buttons: {
65-
Ok: function() { $(this).dialog("close"); }
66-
}
67-
});
60+
new instance.web.Dialog(this,{
61+
title: _t("Document Import Notification"),
62+
buttons: {
63+
Ok: function() { this.parents('.modal').modal('hide');}
64+
}
65+
},$(instance.web.qweb.render("CrashManager.warning", params))).open();
6866
}
6967
});
7068

addons/web_kanban/static/src/js/kanban.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -779,9 +779,9 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
779779
});
780780
var am = instance.webclient.action_manager;
781781
var form = am.dialog_widget.views.form.controller;
782-
form.on("on_button_cancel", am.dialog, am.dialog.close);
782+
form.on("on_button_cancel", am.dialog, function() { return am.dialog.$dialog_box.modal('hide'); });
783783
form.on('record_saved', self, function() {
784-
am.dialog.close();
784+
am.dialog.$dialog_box.modal('hide');
785785
self.view.do_reload();
786786
});
787787
},

0 commit comments

Comments
 (0)