doofinder
Advanced tools
Comparing version 4.1.10 to 4.1.11
{ | ||
"name": "doofinder", | ||
"description": "Javascript Library for Doofinder Search API", | ||
"version": "4.1.10", | ||
"version": "4.1.11", | ||
"main": "dist/doofinder.js", | ||
@@ -6,0 +6,0 @@ "authors": [ |
@@ -11,3 +11,3 @@ (function() { | ||
module.exports = { | ||
version: "4.1.10", | ||
version: "4.1.11", | ||
Client: require("./client"), | ||
@@ -14,0 +14,0 @@ Mustache: require("mustache"), |
@@ -48,2 +48,3 @@ | ||
this.typingTimeout = this.options.typingTimeout || 1000; | ||
this.eventsBound = false; | ||
} | ||
@@ -68,21 +69,26 @@ | ||
self = this; | ||
options = extend(true, { | ||
callback: function() { | ||
var query; | ||
query = self.element.val(); | ||
controller.reset(); | ||
return controller.search.call(controller, query); | ||
}, | ||
wait: 43, | ||
captureLength: 3 | ||
}, this.options); | ||
dfTypeWatch(this.element, options); | ||
ctrl = this.controller[0]; | ||
return ctrl.bind('df:results_received', function(res) { | ||
return setTimeout((function() { | ||
if (ctrl.status.params.query_counter === res.query_counter && ctrl.status.currentPage === 1) { | ||
return self.trigger('df:typing_stopped', [ctrl.status.params.query]); | ||
} | ||
}), self.typingTimeout); | ||
}); | ||
if (!this.eventsBound) { | ||
options = extend(true, { | ||
callback: function() { | ||
var query; | ||
query = self.element.val(); | ||
return self.controller.forEach(function(item) { | ||
item.reset(); | ||
return item.search.call(item, query); | ||
}); | ||
}, | ||
wait: 43, | ||
captureLength: 3 | ||
}, this.options); | ||
dfTypeWatch(this.element, options); | ||
ctrl = this.controller[0]; | ||
ctrl.bind('df:results_received', function(res) { | ||
return setTimeout((function() { | ||
if (ctrl.status.params.query_counter === res.query_counter && ctrl.status.currentPage === 1) { | ||
return self.trigger('df:typing_stopped', [ctrl.status.params.query]); | ||
} | ||
}), self.typingTimeout); | ||
}); | ||
return this.eventsBound = true; | ||
} | ||
}; | ||
@@ -89,0 +95,0 @@ |
{ | ||
"name": "doofinder", | ||
"version": "4.1.10", | ||
"version": "4.1.11", | ||
"description": "Javascript Library for Doofinder Search API", | ||
@@ -5,0 +5,0 @@ "main": "lib/doofinder.js", |
123514
2799