← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19043: GIS hide windows by clicking the mask.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 19043 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-04-28 15:28:51 +0200
message:
  GIS hide windows by clicking the mask.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js	2015-04-28 11:33:27 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js	2015-04-28 12:48:00 +0000
@@ -424,7 +424,8 @@
 			};
 
 			util.gui.window.addHideOnBlurHandler = function(w) {
-				var el = Ext.get(Ext.query('.x-mask')[0]);
+				var maskElements = Ext.query('.x-mask'),
+                    el = Ext.get(maskElements[maskElements.length - 1]);
 
 				el.on('click', function() {
 					if (w.hideOnBlur) {
@@ -436,7 +437,8 @@
 			};
 
 			util.gui.window.addDestroyOnBlurHandler = function(w) {
-				var el = Ext.get(Ext.query('.x-mask')[0]);
+				var maskElements = Ext.query('.x-mask'),
+                    el = Ext.get(maskElements[maskElements.length - 1]);
 
 				el.on('click', function() {
 					if (w.destroyOnBlur) {
@@ -1949,7 +1951,7 @@
 				}
 			],
 			listeners: {
-				show: function() {
+				show: function(w) {
 					if (!this.isRendered) {
 						this.isRendered = true;
 
@@ -2576,7 +2578,16 @@
 				show: function(w) {
 					var pos = gis.viewport.favoriteWindow.getPosition();
 					w.setPosition(pos[0] + 5, pos[1] + 5);
-				}
+
+					if (!w.hasDestroyOnBlurHandler) {
+						gis.util.gui.window.addDestroyOnBlurHandler(w);
+					}
+
+                    gis.viewport.favoriteWindow.destroyOnBlur = false;
+				},
+                destroy: function() {
+                    gis.viewport.favoriteWindow.destroyOnBlur = true;
+                }
 			}
 		});
 
@@ -2796,6 +2807,7 @@
 				resizable: false,
 				modal: true,
 				items: nameTextfield,
+				destroyOnBlur: true,
 				bbar: [
 					cancelButton,
 					'->',
@@ -2805,6 +2817,12 @@
 					show: function() {
 						this.setPosition(favoriteWindow.x + 14, favoriteWindow.y + 67);
 
+                        if (!w.hasDestroyOnBlurHandler) {
+                            gis.util.gui.window.addDestroyOnBlurHandler(w);
+                        }
+
+                        gis.viewport.favoriteWindow.destroyOnBlur = true;
+
 						nameTextfield.focus(false, 500);
 					}
 				}
@@ -3160,6 +3178,7 @@
 			resizable: false,
 			modal: true,
 			width: windowWidth,
+			destroyOnBlur: true,
 			items: [
 				{
 					xtype: 'panel',
@@ -3180,9 +3199,13 @@
 				grid
 			],
 			listeners: {
-				show: function() {
+				show: function(w) {
 					this.setPosition(199, 33);
 
+					if (!w.hasDestroyOnBlurHandler) {
+						gis.util.gui.window.addDestroyOnBlurHandler(w);
+					}
+
 					searchTextfield.focus(false, 500);
 				}
 			}
@@ -4012,6 +4035,7 @@
 			width: windowWidth,
 			modal: true,
 			items: new LegendSetPanel(),
+            destroyOnBlur: true,
 			bbar: {
 				height: 27,
 				items: [
@@ -4023,8 +4047,12 @@
 				]
 			},
 			listeners: {
-				show: function() {
+				show: function(w) {
 					this.setPosition(269, 33);
+
+					if (!w.hasDestroyOnBlurHandler) {
+						gis.util.gui.window.addDestroyOnBlurHandler(w);
+					}
 				},
                 beforeclose: function() {
                     if (window.isDirty) {
@@ -4101,6 +4129,7 @@
             bodyStyle: 'padding:1px',
 			resizable: true,
 			modal: true,
+            destroyOnBlur: true,
 			items: [
 				name,
 				format
@@ -4110,8 +4139,12 @@
 				button
 			],
 			listeners: {
-				show: function() {
+				show: function(w) {
 					this.setPosition(253, 33);
+
+					if (!w.hasDestroyOnBlurHandler) {
+						gis.util.gui.window.addDestroyOnBlurHandler(w);
+					}
 				}
 			}
 		});
@@ -4169,6 +4202,7 @@
                 width: 500,
                 resizable: true,
                 modal: true,
+                destroyOnBlur: true,
                 items: [
                     textArea
                 ],
@@ -4183,9 +4217,13 @@
 					]
 				},
                 listeners: {
-                    show: function() {
+                    show: function(w) {
                         this.setPosition(325, 33);
 
+                        if (!w.hasDestroyOnBlurHandler) {
+                            gis.util.gui.window.addDestroyOnBlurHandler(w);
+                        }
+
 						document.body.oncontextmenu = true;
                     },
 					hide: function() {
@@ -4209,7 +4247,7 @@
 			bodyStyle: 'background:#fff; padding:6px',
 			modal: true,
             resizable: false,
-			hideOnBlur: true,
+			destroyOnBlur: true,
 			listeners: {
 				show: function(w) {
 					Ext.Ajax.request({
@@ -4247,6 +4285,10 @@
                             //}
                         }
 					});
+
+					if (!w.hasDestroyOnBlurHandler) {
+						gis.util.gui.window.addDestroyOnBlurHandler(w);
+					}
 				},
                 hide: function() {
                     document.body.oncontextmenu = function() {
@@ -8853,6 +8895,10 @@
 					listeners: {
 						show: function(w) {
 							this.setPosition(215, 33);
+
+                            if (!w.hasDestroyOnBlurHandler) {
+                                gis.util.gui.window.addDestroyOnBlurHandler(w);
+                            }
 						}
 					}
 				});
@@ -8894,6 +8940,10 @@
 						show: function(w) {
                             this.setPosition(325, 33);
 
+                            if (!w.hasDestroyOnBlurHandler) {
+                                gis.util.gui.window.addDestroyOnBlurHandler(w);
+                            }
+
 							document.body.oncontextmenu = true;
 						},
 						hide: function() {
@@ -8939,6 +8989,10 @@
 						show: function(w) {
                             this.setPosition(325, 33);
 
+                            if (!w.hasDestroyOnBlurHandler) {
+                                gis.util.gui.window.addDestroyOnBlurHandler(w);
+                            }
+
 							document.body.oncontextmenu = true;
 						},
 						hide: function() {

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js	2015-04-28 11:33:27 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js	2015-04-28 12:41:31 +0000
@@ -2097,7 +2097,7 @@
 						},
                         callback: function() {
                             document.body.oncontextmenu = true;
-                            
+
                             if (ns.app.aboutButton.rendered) {
                                 ns.core.web.window.setAnchorPosition(w, ns.app.aboutButton);
 
@@ -2107,7 +2107,7 @@
                             }
                         }
 					});
-				},                
+				},
                 hide: function() {
                     document.body.oncontextmenu = function() {
                         return false;