1

Show spinner for initial ajax query

This commit is contained in:
Alex Yatskov 2014-07-29 07:36:12 +09:00
parent 926cd27136
commit f7a4266276

View File

@ -74,12 +74,6 @@
} }
$(document).ready(function() { $(document).ready(function() {
$.getJSON('/node/keywords', function(keywords) {
for (var i = 0; i < keywords.length; ++i) {
var properties = { value: keywords[i], text: keywords[i] };
$('#keyword').append($('<option></option>', properties));
}
$(document).on({ $(document).on({
ajaxStart: function() { ajaxStart: function() {
$('#spinner').show(); $('#spinner').show();
@ -89,6 +83,12 @@
} }
}); });
$.getJSON('/node/keywords', function(keywords) {
for (var i = 0; i < keywords.length; ++i) {
var properties = { value: keywords[i], text: keywords[i] };
$('#keyword').append($('<option></option>', properties));
}
$('#search').prop('disabled', false); $('#search').prop('disabled', false);
$('#search').click(onSearch); $('#search').click(onSearch);
}); });