]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/browse.js
Refactoring 4 life
[rails.git] / app / assets / javascripts / browse.js
index e21cbd67206a068ce803a0c7bfe1923293b7ad9d..9caaa3714516a9c38e7be80ca1b985e7d3a43035 100644 (file)
@@ -8,11 +8,17 @@ $(document).ready(function () {
 
     $("#linkloader").load(function () { loaded = true; });
 
-    if (select) {
-      $("#linkloader").attr("src", "http://127.0.0.1:8111/load_and_zoom?left=" + left + "&top=" + top + "&right=" + right + "&bottom=" + bottom + "&select=" + select);
-    } else {
-      $("#linkloader").attr("src", "http://127.0.0.1:8111/load_and_zoom?left=" + left + "&top=" + top + "&right=" + right + "&bottom=" + bottom);
-    }
+    var query = {
+        left: left,
+        top: top,
+        right: right,
+        bottom: bottom,
+        select: select
+    };
+
+    if (select) query.select = select;
+    $("#linkloader").attr("src", "http://127.0.0.1:8111/load_and_zoom?" +
+      querystring.stringify(query));
 
     setTimeout(function () {
       if (!loaded) alert(I18n.t('site.index.remote_failed'));