]> dev.renevier.net Git - syj.git/commitdiff
list of created routes: ie support
authorarno <arno@renevier.net>
Wed, 11 Aug 2010 22:25:13 +0000 (00:25 +0200)
committerarno <arno@renevier.net>
Fri, 13 Aug 2010 11:55:04 +0000 (13:55 +0200)
application/controllers/PathController.php
public/css/list.css
public/js/list.js

index b521a2688f9f6f86d8c378e5098d8de57664d761..bb969e82c8ed6b15888a6cf9de01adc0510c7a4e 100644 (file)
@@ -24,14 +24,14 @@ class PathController extends Zend_Controller_Action
         $formData = $this->_helper->SyjPostData->getPostData('Syj_Form_Geom');
         $path = $this->getPath();
         $this->save($path, $formData);
-        $this->_helper->SyjApi->setCode(204);
+        $this->_helper->SyjApi->setCode(200); // we should use 204, but ie mangles 204 to 1223
     }
 
     public function deleteAction() {
         $path = $this->getPath();
         $pathMapper = new Syj_Model_PathMapper();
         $pathMapper->delete ($path);
-        $this->_helper->SyjApi->setCode(204);
+        $this->_helper->SyjApi->setCode(200); // we should use 204, but ie mangles 204 to 1223
     }
 
     public function getPath() {
index 65715c1218d62870c5e043eddce838600aabfa61..4f87230a49d908633f8ccc6f2b65da1e6353c7c1 100644 (file)
@@ -15,6 +15,7 @@
 
 .map {
     position: absolute;
+    width: 100%; height: 100%;
     top: 0; bottom: 0; right: 0; left: 0;
 }
 
index 62f7b068d82c186e5e3e41dc5bf9a01177fb5393..fe0eb62aa86e7d9005a065f49f0f88b286076c19 100644 (file)
@@ -4,7 +4,19 @@ var Mercator = new OpenLayers.Projection("EPSG:900913");
 
 document.observe("dom:loaded", function() {
     $("message").hide();
-    $$(".map").each(function(elt) {
+
+    $$(".item").each(function(elt) {
+        new item(elt);
+    });
+});
+
+function item(elt) {
+    this.deleteHandler = elt.on('click', '.delete-link', this.remove.bindAsEventListener(this));
+    this.elt = elt;
+    this.map = this.createmap(elt.down('.map'));
+}
+item.prototype = {
+    createmap: function(elt) {
         var geom = elt.getAttribute('data-geom'),
             baseLayer = new OpenLayers.Layer.OSM("OSM"),
             map = new OpenLayers.Map(elt, { controls: [], theme: null}),
@@ -24,24 +36,16 @@ document.observe("dom:loaded", function() {
         map.addLayers([baseLayer, viewLayer]);
         viewLayer.addFeatures([wkt.read(geom)]);
         map.zoomToExtent(viewLayer.getDataExtent());
-    });
-
-    $$(".item").each(function(elt) {
-        new item(elt);
-    });
-});
+        return map;
+    },
 
-function item(elt) {
-    this.deleteHandler = elt.on('click', '.delete-link', this.remove.bindAsEventListener(this));
-    this.elt = elt;
-}
-item.prototype = {
     deleteSuccess: function() {
         this.deactivate();
         $("message").setMessage(SyjStrings.deleteSuccess, "success");
     },
 
     deactivate: function() {
+        this.map.destroy();
         this.elt.down('.title').update();
         this.elt.down('.geom').update().setStyle({backgroundColor: 'gray'});
         this.deleteHandler.stop();