make loading indicator work

This commit is contained in:
Sanj 2011-08-31 18:19:25 +05:30
parent c399888ab3
commit df1340cf1b
2 changed files with 3 additions and 1 deletions

View File

@ -16,12 +16,14 @@ $(function() {
e.preventDefault(); e.preventDefault();
var bbox = map.getExtent().toBBOX(); var bbox = map.getExtent().toBBOX();
var search_term = $('#search').val(); var search_term = $('#search').val();
$('#searchField').addClass("loading");
$.getJSON("/feature/search.json", { $.getJSON("/feature/search.json", {
'bbox': bbox, 'bbox': bbox,
'q': search_term, 'q': search_term,
'srid': 3785, 'srid': 3785,
'threshold': 0.5 'threshold': 0.5
}, function(features) { }, function(features) {
$('#searchField').removeClass("loading");
$('#mapList tbody').empty(); $('#mapList tbody').empty();
// var headerRow = getHeaderRow(); // var headerRow = getHeaderRow();
// console.log(response); // console.log(response);

View File

@ -24,7 +24,7 @@
<div class="header"> <div class="header">
<form action="" method="get" class="searchForm" id="searchForm"><!--method is right???--> <form action="" method="get" class="searchForm" id="searchForm"><!--method is right???-->
<input type="text" placeholder="Search digital gazetteer" name="field" class="search loading" /> <input type="text" placeholder="Search digital gazetteer" id="searchField" name="field" class="search" />
<input type="submit" name="searchButton" value="Search" id="searchButton"> <input type="submit" name="searchButton" value="Search" id="searchButton">
</form> </form>