autocomplete adding breakValue options
This commit is contained in:
+5
-4
@@ -312,9 +312,10 @@ var AutoComplete = (function () {
|
||||
select: null,
|
||||
focus: null,
|
||||
},
|
||||
//gnips: adding callback and keydown function
|
||||
//gnips: adding callback, keyfunc and breakvalue
|
||||
selectFunc: function(){},
|
||||
keydownFunc: function(){}
|
||||
keyFunc: function(){},
|
||||
breakValue: []
|
||||
};
|
||||
this._el = element;
|
||||
this._$el = $(this._el);
|
||||
@@ -352,8 +353,8 @@ var AutoComplete = (function () {
|
||||
AutoComplete.prototype.bindDefaultEventListeners = function () {
|
||||
var _this = this;
|
||||
this._$el.on('keydown', function (evt) {
|
||||
//gnips: call keydown function
|
||||
('' == _this._$el.val() && _this._settings.keydownFunc(evt.which));
|
||||
//gnips: check breakValue and call keydown function
|
||||
(('' == _this._$el.val() || ((_this._settings.breakValue.length > 0) && (_this._settings.breakValue.indexOf(_this._$el.val()) != -1))) && _this._settings.keyFunc(evt.which, _this._$el.val()));
|
||||
switch (evt.which) {
|
||||
case 9:
|
||||
if (_this._dd.isItemFocused) {
|
||||
|
||||
Reference in New Issue
Block a user