[FIX]modal close function in kanban and edi
authorCedric Snauwaert <csn@openerp.com>
Mon, 2 Jun 2014 14:41:58 +0000 (16:41 +0200)
committerCedric Snauwaert <csn@openerp.com>
Mon, 2 Jun 2014 14:41:58 +0000 (16:41 +0200)
addons/edi/static/src/js/edi.js
addons/web_kanban/static/src/js/kanban.js

index 91d2b84..69f0635 100644 (file)
@@ -39,16 +39,15 @@ instance.edi.EdiImport = instance.web.Widget.extend({
             });
         }
         else {
-            $('<div>').dialog({
-                modal: true,
-                title: 'Import Successful!',
-                buttons: {
-                    Ok: function() {
-                        $(this).dialog("close");
-                        window.location = "/";
+            new instance.web.Dialog(this,{
+                    title: 'Import Successful!',
+                    buttons: {
+                        Ok: function() {
+                            this.parents('.modal').modal('hide');
+                            window.location = "/";
+                        }
                     }
-                }
-            }).html(_t('The document has been successfully imported!'));
+                },$('<div>').html(_t('The document has been successfully imported!'))).open();
         }
     },
     on_imported_error: function(response){
@@ -58,13 +57,12 @@ instance.edi.EdiImport = instance.web.Widget.extend({
             msg += "\n " + _t("Reason:") + response.data.message;
         }
         var params = {error: response, message: msg};
-        $(instance.web.qweb.render("CrashManager.warning", params)).dialog({
-            title: _t("Document Import Notification"),
-            modal: true,
-            buttons: {
-                Ok: function() { $(this).dialog("close"); }
-            }
-        });
+        new instance.web.Dialog(this,{
+                title: _t("Document Import Notification"),
+                buttons: {
+                    Ok: function() { this.parents('.modal').modal('hide');}
+                }
+            },$(instance.web.qweb.render("CrashManager.warning", params))).open();
     }
 });
 
index db40561..5e5d392 100644 (file)
@@ -779,9 +779,9 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
         });
         var am = instance.webclient.action_manager;
         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() {
-            am.dialog.close();
+            am.dialog.$dialog_box.modal('hide');
             self.view.do_reload();
         });
     },