0013020: Touch devices show double modal popups
authorCornelius Weiß <c.weiss@metaways.de>
Tue, 6 Jun 2017 17:48:08 +0000 (19:48 +0200)
committerCornelius Weiss <c.weiss@metaways.de>
Tue, 6 Jun 2017 17:48:16 +0000 (19:48 +0200)
Change-Id: Ic9379cb1518d33a6ba82c4f1dc3789e804c3ef61
Reviewed-on: http://gerrit.tine20.com/customers/4837
Reviewed-by: Cornelius Weiss <c.weiss@metaways.de>
Tested-by: Cornelius Weiss <c.weiss@metaways.de>
tine20/Tinebase/js/ux/WindowFactory.js

index 31c4803..5a52030 100644 (file)
@@ -73,36 +73,42 @@ Ext.ux.WindowFactory.prototype = {
      * @private
      */
     getExtWindow: function (c) {
-        // add titleBar
-        c.height = c.height + 20;
-        // border width
-        c.width = c.width + 16;
-        
-        //limit the window size
-        c.height = Math.min(Ext.getBody().getBox().height, c.height);
-        c.width = Math.min(Ext.getBody().getBox().width, c.width);
-        
-        c.layout = c.layout || 'fit';
-        c.items = {
-            layout: 'card',
-            border: false,
-            activeItem: 0,
-            isWindowMainCardPanel: true,
-            items: [this.getCenterPanel(c)]
-        };
-        
-        // we can only handle one window yet
-        c.modal = true;
-        
-        var win = new Ext.Window(c);
-        c.items.items[0].window = win;
+        var win = Ext.WindowMgr.get(c.name);
+
+        if (! win) {
+            c.id = c.name;
+
+            // add titleBar
+            c.height = c.height + 20;
+            // border width
+            c.width = c.width + 16;
+
+            //limit the window size
+            c.height = Math.min(Ext.getBody().getBox().height, c.height);
+            c.width = Math.min(Ext.getBody().getBox().width, c.width);
+
+            c.layout = c.layout || 'fit';
+            c.items = {
+                layout: 'card',
+                border: false,
+                activeItem: 0,
+                isWindowMainCardPanel: true,
+                items: [this.getCenterPanel(c)]
+            };
+
+            // we can only handle one window yet
+            c.modal = true;
+
+
+            win = new Ext.Window(c);
+            c.items.items[0].window = win;
+        }
         
         // if initShow property is present and it is set to false don't show window, just return reference
-        if (c.hasOwnProperty('initShow') && c.initShow === false) {
-            return win;
+        if (! c.hasOwnProperty('initShow') || c.initShow !== false) {
+            win.show();
         }
         
-        win.show();
         return win;
     },