2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-11-22 12:55:12 +00:00

place event listeners in options parameter.

This commit is contained in:
김 재석 2016-05-27 14:20:32 +09:00
parent b9a8b7e4ad
commit 5bd229febe

View File

@ -204,11 +204,29 @@
$(window).on('resize.autocomplete', that.fixPositionCapture);
if ($.isFunction(that.options.onKeyPress)) {
that.el.on('keydown.autocomplete', function (e) { that.options.onKeyPress.call(that, e); });
}
that.el.on('keydown.autocomplete', function (e) { that.onKeyPress(e); });
if ($.isFunction(that.options.onKeyUp)) {
that.el.on('keyup.autocomplete', function (e) { that.options.onKeyUp.call(that, e); });
}
that.el.on('keyup.autocomplete', function (e) { that.onKeyUp(e); });
if ($.isFunction(that.options.onBlur)) {
that.el.on('blur.autocomplete', function (e) { that.options.onBlur.call(that, e); });
}
that.el.on('blur.autocomplete', function () { that.onBlur(); });
if ($.isFunction(that.options.onFocus)) {
that.el.on('focus.autocomplete', function (e) { that.options.onFocus.call(that, e); });
}
that.el.on('focus.autocomplete', function () { that.onFocus(); });
if ($.isFunction(that.options.onKeyUp)) {
that.el.on('change.autocomplete', function (e) { that.options.onKeyUp.call(that, e); });
}
that.el.on('change.autocomplete', function (e) { that.onKeyUp(e); });
if ($.isFunction(that.options.onKeyUp)) {
that.el.on('input.autocomplete', function (e) { that.options.onKeyUp.call(that, e); });
}
that.el.on('input.autocomplete', function (e) { that.onKeyUp(e); });
},