X-Git-Url: https://dev.renevier.net/?a=blobdiff_plain;f=public%2Fjs%2Fsyj.js;h=62b2936a1248da6545966d3b0e95a43a41d0628f;hb=5f933abf0cc28142a0c4ed8d41ac79fd897ddb14;hp=7b2448cb09481b86a79f90f6120ae6178173baaf;hpb=a406f7ab23d1089170517a8997e1c2221e5748a0;p=syj.git diff --git a/public/js/syj.js b/public/js/syj.js index 7b2448c..62b2936 100644 --- a/public/js/syj.js +++ b/public/js/syj.js @@ -1,4 +1,4 @@ -/* This file is part of Syj, Copyright (c) 2010 Arnaud Renevier, +/* This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier, and is published under the AGPL license. */ // avoid openlayers alerts @@ -100,7 +100,12 @@ var SYJDataUi = (function() { if (!infotoggler) { infotoggler = new Toggler('path-infos-content'); $("path-infos-toggler").insert({bottom: infotoggler.element}); - $("path-infos-anchor").observe('click', function(evt) { + var anchor = $("path-infos-anchor"); + var parent = anchor.up('.menu-item'); + if (parent) { + anchor = parent; + } + anchor.observe('click', function(evt) { evt.stop(); infotoggler.toggle(evt); }); @@ -283,7 +288,11 @@ var SYJView = { theme: null }); - baseLayer = new OpenLayers.Layer.OSM("OSM", null, { wrapDateLine: true , attribution: SyjStrings.osmAttribution }); + baseLayer = new OpenLayers.Layer.OSM("OSM", [ + 'http://a.tile.openstreetmap.org/${z}/${x}/${y}.png', + 'http://b.tile.openstreetmap.org/${z}/${x}/${y}.png', + 'http://c.tile.openstreetmap.org/${z}/${x}/${y}.png'], + { attribution: SyjStrings.osmAttribution }); layerOptions = {format: OpenLayers.Format.WKT, projection: WGS84, @@ -611,15 +620,6 @@ var SYJView = { case 400: case 404: message = SyjStrings.requestError; - if (transport.responseJSON) { - switch (transport.responseJSON.message) { - case "uniquepath": - message = SyjStrings.uniquePathError; - break; - default: - break; - } - } break; case 403: message = ""; @@ -660,7 +660,12 @@ var SYJModalClass = Class.create({ closeMethods: ["onescapekey", "onouterclick", "onbutton"] }); - $(this.type + "_control_anchor").observe("click", function(evt) { + var anchor = $(this.type + '_control_anchor'); + var parent = anchor.up('.menu-item'); + if (parent) { + anchor = parent; + } + anchor.observe("click", function(evt) { this.modalbox.show(); evt.stop(); }.bindAsEventListener(this));