← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1623: (GIS) The corrent panel, zoom level and map position are now restored when the print panel is clo...

 

------------------------------------------------------------
revno: 1623
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-03-11 15:08:07 +0100
message:
  (GIS) The corrent panel, zoom level and map position are now restored when the print panel is closed.
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.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/script/index.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js	2010-03-10 14:41:28 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js	2010-03-11 14:08:07 +0000
@@ -2761,16 +2761,10 @@
             expand: {
                 fn: function() {
                     choroplethLayer.setVisibility(false);
-                    choropleth.classify(false);
-                    
+                    choropleth.classify(false, true);
                     ACTIVEPANEL = thematicMap;
                 }
-            },
-			collapse: {
-				fn: function() {
-					ACTIVEPANEL = false;
-				}
-			}
+            }
         }
     });
     
@@ -2787,16 +2781,10 @@
             expand: {
                 fn: function() {
                     choroplethLayer.setVisibility(false);
-                    mapping.classify(false);
-                    
+                    mapping.classify(false, true);
                     ACTIVEPANEL = organisationUnitAssignment;
                 }
-            },
-			collapse: {
-				fn: function() {
-					ACTIVEPANEL = false;
-				}
-			}
+            }
         }
     });
 	
@@ -2862,6 +2850,7 @@
 	});
 	
 	function showPdf() {
+		var active = ACTIVEPANEL;
 		var printMultiPagePanel = Ext.getCmp('printMultiPage_p');
 		if (printMultiPagePanel.hidden) {
             printMultiPagePanel.show();
@@ -2870,7 +2859,12 @@
         else {
 			printMultiPagePanel.collapse();
 			printMultiPagePanel.hide();
-			choropleth.expand();
+			if (active == thematicMap) {
+				choropleth.expand();
+			}
+			else if (active == organisationUnitAssignment) {
+				mapping.expand();
+			}
         }
 	}	
 	
@@ -3086,8 +3080,8 @@
     shapefilePanel.hide();
 	mapping.hide();
     mapLayerPanel.hide();
+	Ext.getCmp('printMultiPage_p').hide();
 	ACTIVEPANEL = thematicMap;
-	Ext.getCmp('printMultiPage_p').hide();
     
 	/* MAP CONTROLS */
 	var selectFeatureChoropleth = new OpenLayers.Control.newSelectFeature(