changeset 253:d6c7bedf4370

New reload button active in upper right corner of block
author fknauft
date Fri, 23 Sep 2011 13:11:46 +0200
parents efd2469d1722
children 901c1f745d13
files gis_gui/blocks/layer.js gis_gui/blocks/map.js gis_gui/blocks/template.pt gis_gui/lib/blocks.js
diffstat 4 files changed, 20 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gis_gui/blocks/layer.js	Tue Sep 20 11:19:35 2011 +0200
+++ b/gis_gui/blocks/layer.js	Fri Sep 23 13:11:46 2011 +0200
@@ -96,6 +96,12 @@
             console.debug("layer create map. this=",this," block=",block);
             var mapblock = blocks.addMapBlock("blocks/map.html?layer="+escape(params.name),"map",null,params);
         });
+        // reload button (upper right corner of Block)
+        $(be).find(".reload_button").click(function () {
+            console.debug("layer update");
+            params = block.readLayerParams();
+            block.updateLayer(be,params);
+        });
         
     });
 };
--- a/gis_gui/blocks/map.js	Tue Sep 20 11:19:35 2011 +0200
+++ b/gis_gui/blocks/map.js	Fri Sep 23 13:11:46 2011 +0200
@@ -35,6 +35,13 @@
             params = block.readMapParams();
             map=block.updateMap(be,params);
         });
+        // reload button
+        $(be).find(".reload_button").click(function () {
+            console.debug("map update");
+            params = block.readMapParams();
+            map=block.updateMap(be,params);
+        });
+
         // new window button
       /*  $(be).find(".map_newwindow_button").click(function () {
             console.debug("map in new window");
@@ -46,7 +53,7 @@
         // reload button
         $(be).find(".map_reload_button").click(function () {
             console.debug("reload map");
-            block.reloadMap(map);
+            block.reloadMap();
         });
          // save button
         $(be).find(".map_save_button").click(function () {
@@ -141,7 +148,10 @@
     return params;
 };
 
-guiBlocks.Block.prototype.reloadMap = function(map) {
+guiBlocks.Block.prototype.reloadMap = function(elem) {
+	if (elem == null) {
+        elem = this.element;
+    }
 	/*var center = map.getCenter();
 	var dummymarker = new google.maps.Marker();
 	dummymarker.setPosition(center);
--- a/gis_gui/blocks/template.pt	Tue Sep 20 11:19:35 2011 +0200
+++ b/gis_gui/blocks/template.pt	Fri Sep 23 13:11:46 2011 +0200
@@ -10,7 +10,7 @@
       <tal:block tal:condition="python:impermanent=='true'">
       	<div class="close_button"> x </div>
       	<!-- FJK: das soll ein Reload-Button werden -->
-      	<!--  <div class="reload_button" ><img src="./icons/reload.png" alt="Reload" style="width: 20px;"></div> -->
+        <div class="reload_button" ><img src="./icons/reload.png" alt="Reload" style="width: 20px;"></div>
       </tal:block>
       <div class="type_icon"> <tal:block metal:define-slot="icon"></tal:block> </div>
     </div>
--- a/gis_gui/lib/blocks.js	Tue Sep 20 11:19:35 2011 +0200
+++ b/gis_gui/lib/blocks.js	Fri Sep 23 13:11:46 2011 +0200
@@ -62,6 +62,7 @@
     	console.debug(container);
     	$(this).find(".block").attr("id",newid);
     	$(this).appendTo(container);
+ 
     	// chain done function
         if (typeof(whenDone) == "function") {
         	// chain whenDone (should we add parameters?)