From 2b43cc90b7abb89686d2063597e1a4e0f2434840 Mon Sep 17 00:00:00 2001 From: Sanj Date: Mon, 20 Feb 2012 19:34:51 +0530 Subject: [PATCH] silly error + loading behaviour --- chaloBEST/static/js/editstops.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chaloBEST/static/js/editstops.js b/chaloBEST/static/js/editstops.js index 9cd8a4c..93ac9c8 100644 --- a/chaloBEST/static/js/editstops.js +++ b/chaloBEST/static/js/editstops.js @@ -34,7 +34,7 @@ $(function() { $('.list').click(function(e) { var name = $(this).attr("id").replace("List", ""); var $target = $(e.target); - if (!target.hasClass('list')) { + if (!$target.hasClass('list')) { return; } if ($target.data("loading")) { @@ -46,7 +46,9 @@ $(function() { } var url = API_BASE + name + "/" + $target.text(); $target.data("loading", true); + var $loading = $('').addClass("loadingSpan").text("Loading...").appendTo($target); $.getJSON(url, {}, function(area) { + $loading.remove(); var stops = area.stops.features; var $stopsList = getStopsList(stops); $target.append($stopsList);