Bind enter key to start a search, skipping minimum character limit

This commit is contained in:
Nathan Gray 2012-04-05 22:57:38 +00:00
parent 22cb0667eb
commit 18f3d46ca8

View File

@ -402,6 +402,17 @@ var et2_link_entry = et2_inputWidget.extend({
disabled: self.options.disabled disabled: self.options.disabled
}); });
// Bind to enter key to start search early
this.search.keydown(function(e) {
var keycode = (e.keyCode ? e.keyCode : e.which);
if(keycode == '13')
{
self.search.autocomplete("option","minLength", 0);
self.search.autocomplete("search");
self.search.autocomplete("option","minLength", self.minimum_characters);
e.stopPropagation();
}
});
this.setDOMNode(this.div[0]); this.setDOMNode(this.div[0]);
}, },