← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3204: (GIS) Popup window behaviour improved.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 3204 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-03-29 13:20:01 +0200
message:
  (GIS) Popup window behaviour improved.
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.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-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js	2011-03-29 09:15:25 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js	2011-03-29 11:18:51 +0000
@@ -2425,12 +2425,12 @@
 
             var mapView = scope.formValues.getAllValues.call(scope);
             mapView.widget = scope;
-            mapView.timestamp = new Date();
+            mapView.timestamp = G.date.getNowHMS(new Date());
             var c1 = '<span class="menu-item-inline-c1">';
             var c2 = '<span class="menu-item-inline-c2">';
             var spanEnd = '</span>';
             mapView.label = '<span class="menu-item-inline-bg">' +
-                            c1 + G.date.getNowHMS(mapView.timestamp) + spanEnd +
+                            c1 + mapView.timestamp + spanEnd +
                             c2 + mapView.parentOrganisationUnitName + spanEnd +
                             c1 + '( ' + mapView.organisationUnitLevelName + ' )' + spanEnd + 
                             c2 + (mapView.mapValueType == G.conf.map_value_type_indicator ? mapView.indicatorName : mapView.dataElementName) + spanEnd +
@@ -2438,7 +2438,7 @@
                             spanEnd;
             
             for (var i = 0; i < this.menu.items.items.length; i++) {
-                if (G.util.compareObjToObj(mapView, this.menu.items.items[i].mapView, ['longitude','latitude','zoom','widget','timestamp','label'])) {
+                if (G.util.compareObjToObj(mapView, this.menu.items.items[i].mapView, ['longitude','latitude','zoom','widget','timestamp','time','label'])) {
                     this.menu.items.items[i].destroy();
                 }
             }
@@ -2455,14 +2455,13 @@
 		tooltip: G.i18n.favorite_map_views,
         style: 'margin-top:1px',
 		handler: function() {
-			var x = Ext.getCmp('center').x + G.conf.window_position_x;
-			var y = Ext.getCmp('center').y + G.conf.window_position_y;    
-			favoriteWindow.setPosition(x,y);
-
-			if (favoriteWindow.visible) {
+            if (!favoriteWindow.hidden) {
 				favoriteWindow.hide();
 			}
 			else {
+                var x = Ext.getCmp('center').x + G.conf.window_position_x;
+                var y = Ext.getCmp('center').y + G.conf.window_position_y;    
+                favoriteWindow.setPosition(x,y);
 				favoriteWindow.show();
 			}
 		}
@@ -2477,16 +2476,14 @@
 				Ext.message.msg(false, 'SVG not supported by browser');
 				return;
 			}
-			
-			var x = Ext.getCmp('center').x + G.conf.window_position_x;
-			var y = Ext.getCmp('center').y + G.conf.window_position_y;   
-			
-			exportImageWindow.setPosition(x,y);
-
-			if (exportImageWindow.visible) {
+            
+            if (!exportImageWindow.hidden) {
 				exportImageWindow.hide();
 			}
 			else {
+                var x = Ext.getCmp('center').x + G.conf.window_position_x;
+                var y = Ext.getCmp('center').y + G.conf.window_position_y;			
+                exportImageWindow.setPosition(x,y);
 				exportImageWindow.show();
 			}
 		}
@@ -2497,15 +2494,14 @@
 		tooltip: G.i18n.predefined_legend_sets,
 		disabled: !G.user.isAdmin,
         style: 'margin-top:1px',
-		handler: function() {
-			var x = Ext.getCmp('center').x + G.conf.window_position_x;
-			var y = Ext.getCmp('center').y + G.conf.window_position_y;
-			predefinedMapLegendSetWindow.setPosition(x,y);
-		
-			if (predefinedMapLegendSetWindow.visible) {
+		handler: function() {		
+			if (!predefinedMapLegendSetWindow.hidden) {
 				predefinedMapLegendSetWindow.hide();
 			}
 			else {
+                var x = Ext.getCmp('center').x + G.conf.window_position_x;
+                var y = Ext.getCmp('center').y + G.conf.window_position_y;
+                predefinedMapLegendSetWindow.setPosition(x,y);
 				predefinedMapLegendSetWindow.show();
                 if (!G.stores.predefinedMapLegend.isLoaded) {
                     G.stores.predefinedMapLegend.load();
@@ -2520,10 +2516,15 @@
 		disabled: !G.user.isAdmin,
         style: 'margin-top:1px',
 		handler: function() {
-			var x = Ext.getCmp('center').x + G.conf.window_position_x;
-			var y = Ext.getCmp('center').y + G.conf.window_position_y;
-			adminWindow.setPosition(x,y);
-			adminWindow.show();
+            if (!adminWindow.hidden) {
+                adminWindow.hide();
+            }
+            else {
+                var x = Ext.getCmp('center').x + G.conf.window_position_x;
+                var y = Ext.getCmp('center').y + G.conf.window_position_y;
+                adminWindow.setPosition(x,y);
+                adminWindow.show();
+            }
 		}
 	});
 	
@@ -2532,10 +2533,15 @@
 		tooltip: G.i18n.help,
         style: 'margin-top:1px',
 		handler: function() {
-			var c = Ext.getCmp('center').x;
-			var e = Ext.getCmp('east').x;
-			helpWindow.setPagePosition(c+((e-c)/2)-280, Ext.getCmp('east').y + 100);
-			helpWindow.show();
+            if (!helpWindow.hidden) {
+                helpWindow.hide();
+            }
+            else {
+                var c = Ext.getCmp('center').x;
+                var e = Ext.getCmp('east').x;
+                helpWindow.setPagePosition(c+((e-c)/2)-280, Ext.getCmp('east').y + 100);
+                helpWindow.show();
+            }
 		}
 	});
 

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js	2011-03-28 12:50:18 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js	2011-03-29 10:27:11 +0000
@@ -1414,11 +1414,13 @@
             this.form.findField('startdate').reset();
             this.form.findField('enddate').reset();
             
-            this.form.findField('boundary').reset();
-            this.form.findField('level').reset();
-            if (this.form.findField('boundary').treePanel && this.form.findField('level').levelComboBox) {
-                this.form.findField('boundary').treePanel.selectPath(this.form.findField('boundary').treePanel.getRootNode().getPath());
-                this.form.findField('level').levelComboBox.clearValue();
+            var boundary = this.form.findField('boundary')
+            var level = this.form.findField('level');
+            boundary.reset();
+            level.reset();
+            if (boundary.treePanel && level.levelComboBox) {
+                boundary.treePanel.selectPath(boundary.treePanel.getRootNode().getPath());
+                level.levelComboBox.clearValue();
             }
             
             this.legend.reset();
@@ -1428,8 +1430,7 @@
             this.form.findField('bounds').reset();
             
             this.layer.destroyFeatures();
-            this.layer.setVisibility(false);
-            
+            this.layer.setVisibility(false);            
         }
 	},
     

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.js	2011-03-28 12:50:18 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Symbol.js	2011-03-29 10:27:11 +0000
@@ -1411,9 +1411,10 @@
             this.form.findField('startdate').reset();
             this.form.findField('enddate').reset();
             
-            this.form.findField('boundary').reset();
-            if (this.form.findField('boundary').treePanel) {
-                this.form.findField('boundary').treePanel.selectPath(this.form.findField('boundary').treePanel.getRootNode().getPath());
+            var boundary = this.form.findField('boundary');
+            boundary.reset();
+            if (boundary.treePanel) {
+                boundary.treePanel.selectPath(boundary.treePanel.getRootNode().getPath());
             }
             
             this.legend.reset();