|
|
|
|
@ -577,17 +577,24 @@ if (EXPO.searchBlock){ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
// var newData = ['banan','banan2','banan3','banan4','banan5'];
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* the ID value of the timer that is set |
|
|
|
|
*/ |
|
|
|
|
self.timeout; |
|
|
|
|
self.$inputFilter.attr('autocomplete', 'on'); |
|
|
|
|
|
|
|
|
|
self.$inputFilter.on('keyup', function (event) { |
|
|
|
|
text = $(this).val(); |
|
|
|
|
event.stopImmediatePropagation(); |
|
|
|
|
|
|
|
|
|
clearTimeout(self.timeout); |
|
|
|
|
|
|
|
|
|
if (text.length > 2 && firstComplete){ |
|
|
|
|
getRequest({'term':text, 'form':form}, self.opt.autoCompleteUrl, requestHandler); |
|
|
|
|
firstComplete = false; |
|
|
|
|
self.timeout = setTimeout(function () { |
|
|
|
|
getRequest({'term':text, 'form':form}, self.opt.autoCompleteUrl, requestHandler); |
|
|
|
|
firstComplete = false; |
|
|
|
|
}, 1000); |
|
|
|
|
|
|
|
|
|
}else if(text.length == 0 && !firstComplete){ |
|
|
|
|
if(self.$inputFilter.hasClass('ui-autocomplete-input')){ |
|
|
|
|
|
|
|
|
|
@ -1604,17 +1611,24 @@ if (EXPO.searchBlock){ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
// var newData = ['banan','banan2','banan3','banan4','banan5'];
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* the ID value of the timer that is set |
|
|
|
|
*/ |
|
|
|
|
self.timeout; |
|
|
|
|
self.$inputFilter.attr('autocomplete', 'on'); |
|
|
|
|
|
|
|
|
|
self.$inputFilter.on('keyup', function (event) { |
|
|
|
|
text = $(this).val(); |
|
|
|
|
event.stopImmediatePropagation(); |
|
|
|
|
|
|
|
|
|
clearTimeout(self.timeout); |
|
|
|
|
|
|
|
|
|
if (text.length > 2 && firstComplete){ |
|
|
|
|
getRequest({'term':text, 'form':form}, self.opt.autoCompleteUrl, requestHandler); |
|
|
|
|
firstComplete = false; |
|
|
|
|
self.timeout = setTimeout(function () { |
|
|
|
|
getRequest({'term':text, 'form':form}, self.opt.autoCompleteUrl, requestHandler); |
|
|
|
|
firstComplete = false; |
|
|
|
|
}, 1000); |
|
|
|
|
|
|
|
|
|
}else if(text.length == 0 && !firstComplete){ |
|
|
|
|
if(self.$inputFilter.hasClass('ui-autocomplete-input')){ |
|
|
|
|
|
|
|
|
|
@ -1996,14 +2010,20 @@ if (EXPO.searchBlock){ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
this.completeName = 'autocomplete', |
|
|
|
|
this.firstComplete = true; |
|
|
|
|
this.completeName = 'autocomplete'; |
|
|
|
|
this.firstComplete = true; |
|
|
|
|
this.$field.attr('autocomplete','off'); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* the ID value of the timer that is set |
|
|
|
|
*/ |
|
|
|
|
this.timeout; |
|
|
|
|
//autocomplete behaviour
|
|
|
|
|
self.$field.on('keyup', function (event) { |
|
|
|
|
var reqObj; |
|
|
|
|
text = $(this).val(); |
|
|
|
|
event.stopImmediatePropagation(); |
|
|
|
|
clearTimeout(self.timeout); |
|
|
|
|
if(self.dataForm){ |
|
|
|
|
reqObj = { |
|
|
|
|
'term':text, |
|
|
|
|
@ -2016,15 +2036,18 @@ if (EXPO.searchBlock){ |
|
|
|
|
} |
|
|
|
|
if(self.opt.anyChar){ |
|
|
|
|
if (text.length > 2){ |
|
|
|
|
getRequest(reqObj, self.opt.autoCompleteUrl, function (data) { |
|
|
|
|
if(self.$field.hasClass('ui-autocomplete-input')){ |
|
|
|
|
self.$field[self.completeName]( "destroy" ); |
|
|
|
|
self.timeout = setTimeout(function () { |
|
|
|
|
getRequest(reqObj, self.opt.autoCompleteUrl, function (data) { |
|
|
|
|
if(self.$field.hasClass('ui-autocomplete-input')){ |
|
|
|
|
self.$field[self.completeName]( "destroy" ); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
self.rawData.set(data); |
|
|
|
|
self._initAutoComplete(); |
|
|
|
|
self.showList(''); |
|
|
|
|
}); |
|
|
|
|
}, 1000); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
self.rawData.set(data); |
|
|
|
|
self._initAutoComplete(); |
|
|
|
|
self.showList(''); |
|
|
|
|
}); |
|
|
|
|
} else if(text.length === 0){ |
|
|
|
|
if(self.$field.hasClass('ui-autocomplete-input')){ |
|
|
|
|
self.$field[self.completeName]( "destroy" ); |
|
|
|
|
@ -2034,14 +2057,15 @@ if (EXPO.searchBlock){ |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
if (text.length > 2 && firstComplete){ |
|
|
|
|
getRequest(reqObj, self.opt.autoCompleteUrl, function (data) { |
|
|
|
|
self.timeout = setTimeout(function () { |
|
|
|
|
getRequest(reqObj, self.opt.autoCompleteUrl, function (data) { |
|
|
|
|
self.rawData.set(data); |
|
|
|
|
self._initAutoComplete(); |
|
|
|
|
self.showList(''); |
|
|
|
|
}); |
|
|
|
|
firstComplete = false; |
|
|
|
|
}, 1000); |
|
|
|
|
|
|
|
|
|
self.rawData.set(data); |
|
|
|
|
self._initAutoComplete(); |
|
|
|
|
self.showList(''); |
|
|
|
|
// self.DOMcompleteWrap.addClass('full-visible');
|
|
|
|
|
}); |
|
|
|
|
firstComplete = false; |
|
|
|
|
}else if(text.length == 0 && !firstComplete){ |
|
|
|
|
if(self.$field.hasClass('ui-autocomplete-input')){ |
|
|
|
|
|
|
|
|
|
|