projects
/
rails.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5f970fe
)
Abort any existing requests when starting new ones
author
Tom Hughes
<tom@compton.nu>
Thu, 13 Mar 2014 22:59:36 +0000
(22:59 +0000)
committer
Tom Hughes
<tom@compton.nu>
Sun, 16 Mar 2014 16:18:13 +0000
(16:18 +0000)
app/assets/javascripts/index/query.js
patch
|
blob
|
history
diff --git
a/app/assets/javascripts/index/query.js
b/app/assets/javascripts/index/query.js
index bc4c26771913e6f4fbb855fc3b7064400b0f0482..fb8649025328af184e9b5aa60e919941a4bd0d36 100644
(file)
--- a/
app/assets/javascripts/index/query.js
+++ b/
app/assets/javascripts/index/query.js
@@
-176,7
+176,11
@@
OSM.Query = function(map) {
$(this).show();
});
$(this).show();
});
- $.ajax({
+ if ($section.data("ajax")) {
+ $section.data("ajax").abort();
+ }
+
+ $section.data("ajax", $.ajax({
url: OSM.OVERPASS_URL,
method: "POST",
data: {
url: OSM.OVERPASS_URL,
method: "POST",
data: {
@@
-213,7
+217,7
@@
OSM.Query = function(map) {
.appendTo($ul);
}
}
.appendTo($ul);
}
}
- });
+ })
)
;
}
function queryOverpass(lat, lng) {
}
function queryOverpass(lat, lng) {