updateSelection();
}
}).mouseup(function() {
- if (!($(this).find('a').is(':hover'))) {
- $(this).find('a').click();
+ var sel = $(this).find('a');
+ try {
+ if (!sel.is(':hover')) {
+ sel.click();
+ }
+ } catch (e) {
+ sel.click();
}
});
return data;
$.fn.extend({
quickSearch: function(options) {
- var $this = this;
- var $input = $this.get(0);
+ return this.each(function() {
+ var $this = $(this);
+ var $input = this;
var $popup;
var previous = null;
var pending = false;
var disabled = false;
var updatePopup;
- var loadingClass;
options = options || { };
options = $.extend({
$(this).popWin(840, 600);
}
}, options);
- console.log(options);
options.loadingClass = $this.css('text-align') === 'right' ? options.loadingClassRight
: options.loadingClassLeft;
$this.attr('autocomplete', 'off');
- $popup = buildPopup(this, options.destination, function() {
+ $popup = buildPopup($this, options.destination, function() {
options.selectAction.apply(this, arguments);
$(this).click(function() {
$popup.hide();
updatePopup = doUpdatePopup;
- return this.keyup(function(e) {
+ return $this.keyup(function(e) {
if (e.keyCode !== 27 /* escape */ && e.keyCode !== 13 /* enter */
&& e.keyCode !== 9 /* tab */ && e.keyCode !== 38 /* up */
&& e.keyCode !== 40 /* down */) {
.blur(function() {
return $popup.hide(true);
})
- .focus(updatePopup);
+ .focus(updatePopup);});
}
});
}(jQuery));