Added standard fields, login/reset display improvements

This commit is contained in:
Deon George
2016-08-18 12:34:53 +10:00
parent a7616960f0
commit 2b48dde8f7
14 changed files with 155 additions and 182 deletions

View File

@@ -16,7 +16,7 @@ $(document).ready(function() {
});
var c=0;
var search = _.debounce(function(url,query,process){
var search = _.debounce(function(url,query,process,icon){
$.ajax({
url : site_url+url,
type : 'GET',
@@ -25,8 +25,12 @@ var search = _.debounce(function(url,query,process){
async : true,
cache : false,
beforeSend : function() {
if (c++ == 0)
$('i[name=searching]').removeClass("hidden");
if (c++ == 0) {
if (icon)
$('i[name='+icon+']').addClass("fa-spin");
else
$('i[name=searching]').removeClass("hidden");
}
},
success : function(data) {
// if json is null, means no match, won't do again.
@@ -46,8 +50,12 @@ var search = _.debounce(function(url,query,process){
process(userLabels);
},
complete : function() {
if (--c == 0)
$('i[name=searching]').addClass("hidden");
if (--c == 0) {
if (icon)
$('i[name='+icon+']').removeClass("fa-spin");
else
$('i[name=searching]').addClass("hidden");
}
}
})
}, 500);