changeset 1017:cce6596560e6

After resizing the window, the map panel is resized as well (currently just the width changes) (issue307). gnv/trunk@1247 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 30 Jun 2010 05:50:46 +0000
parents 3665834344a8
children 4eb7fa8a36ed
files gnv/ChangeLog gnv/src/main/webapp/scripts/viewport.jsp
diffstat 2 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gnv/ChangeLog	Tue Jun 29 15:41:10 2010 +0000
+++ b/gnv/ChangeLog	Wed Jun 30 05:50:46 2010 +0000
@@ -1,3 +1,14 @@
+2010-06-30  Ingo Weinzierl <ingo.weinzierl@intevation.de>
+
+	  Issue307
+
+	* src/main/webapp/scripts/viewport.jsp: Added a 'resize' listener for the
+	  browser window. If the browser window is resized, the size of the map
+	  panel is adapted. For example, you have a small browser window at the
+	  beginning and resize it later to its maximal size, the map panel takes all
+	  the place it can get. Currently, just the width is adapted, because outer
+	  div container has a fix height that doesn't change.
+
 2010-06-29  Tim Englich  <tim.englich@intevation.de>
 
 	  ISSU317
--- a/gnv/src/main/webapp/scripts/viewport.jsp	Tue Jun 29 15:41:10 2010 +0000
+++ b/gnv/src/main/webapp/scripts/viewport.jsp	Wed Jun 30 05:50:46 2010 +0000
@@ -100,7 +100,6 @@
         region: "center",
         map: map,
         layers: layers
-        
     });
 
     //map.setCenter(INITIAL_CENTER);
@@ -292,4 +291,11 @@
     });
     <%}%>
     map.zoomToExtent(CURRENT_EXTENT);
+
+    // some code for automatically resizing the map panel if the window size
+    // changes
+    window.onresize=function() {
+        var mapcontainer = Ext.get('mapcontainer');
+        mapPanel.setSize(mapcontainer.getSize());
+    }
 });

http://dive4elements.wald.intevation.org