]> dev.renevier.net Git - syj.git/blobdiff - public/js/syj.js
redirection after path creation is decided by server (php), not guessed by client...
[syj.git] / public / js / syj.js
index 5400ff3afcd7b4fd20516aef480a178748c3d2f8..4b7f01d9a39dda1f010856080f130cc806577a0f 100644 (file)
@@ -225,7 +225,6 @@ var SYJView = {
     map: null,
     wkt: new OpenLayers.Format.WKT({ internalProjection: Mercator, externalProjection: WGS84 }),
     needsFormResubmit: false,
-    hasInitialGeom: false,
 
     init: function() {
         var externalGraphic, baseURL, baseLayer, layerOptions, extent, hidemessenger;
@@ -285,7 +284,6 @@ var SYJView = {
             // XXX: ie has not guessed height of map main div yet during map
             // initialisation. Now, it will read it correctly.
             this.map.updateSize();
-            this.hasInitialGeom = true;
         } else {
             extent = new OpenLayers.Bounds(gMaxExtent.minlon, gMaxExtent.minlat, gMaxExtent.maxlon, gMaxExtent.maxlat)
                                          .transform(WGS84, Mercator);
@@ -396,8 +394,8 @@ var SYJView = {
     },
 
     saveSuccess: function(transport) {
-      if (!this.hasInitialGeom) { // we have created a new path, change location
-          location = "idx/" + transport.responseText;
+      if (transport.responseJSON && (typeof transport.responseJSON.redirect === "string")) {
+          location = transport.responseJSON.redirect;
           return;
       }