added the spinners #3

pull/13/head
tidusjar 9 years ago
parent 895558218a
commit 723993b099

@ -10,17 +10,22 @@ var searchTemplate = Handlebars.compile(searchSource);
var movieTimer = 0;
var tvimer = 0;
$("#movieSearchContent").keypress(function () {
// Type in movie search
$("#movieSearchContent").on("input", function () {
if (movieTimer) {
clearTimeout(movieTimer);
}
$('#movieSearchButton').attr("class","fa fa-spinner fa-spin");
movieTimer = setTimeout(movieSearch, 400);
});
$("#tvSearchContent").keypress(function () {
// Type in TV search
$("#tvSearchContent").on("input", function () {
if (tvimer) {
clearTimeout(tvimer);
}
$('#tvSearchButton').attr("class", "fa fa-spinner fa-spin");
tvimer = setTimeout(tvSearch, 400);
});
@ -31,7 +36,6 @@ $(document).on("click", ".dropdownTv", function (e) {
e.preventDefault();
var $form = $('#form' + buttonId);
var data = $form.serialize();
var seasons = $(this).attr("season-select");
@ -103,6 +107,7 @@ function movieSearch() {
$("#movieList").append(html);
});
}
$('#movieSearchButton').attr("class","fa fa-search");
});
};
@ -118,6 +123,7 @@ function tvSearch() {
$("#tvList").append(html);
});
}
$('#tvSearchButton').attr("class", "fa fa-search");
});
};

@ -23,7 +23,7 @@
<div class="input-group">
<input id="movieSearchContent" type="text" class="form-control">
<div class="input-group-addon">
<i class="fa fa-search"></i>
<i id="movieSearchButton" class="fa fa-search"></i>
</div>
</div>
<br />
@ -42,7 +42,7 @@
<div class="input-group">
<input id="tvSearchContent" type="text" class="form-control">
<div class="input-group-addon">
<i class="fa fa-search"></i>
<i id="tvSearchButton" class="fa fa-search"></i>
</div>
</div>
<br />

Loading…
Cancel
Save