All Downloads are FREE. Search and download functionalities are using the official Maven repository.

template.js.base.jquery.ui.autocomplete.min.js Maven / Gradle / Ivy

There is a newer version: 5.0.3
Show newest version
/*! jQuery UI - v1.10.4 - 2014-04-02
 * http://jqueryui.com
 * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */

(function (e) {
    e.widget("ui.autocomplete", {version: "1.10.4", defaultElement: "", options: {appendTo: null, autoFocus: !1, delay: 300, minLength: 1, position: {my: "left top", at: "left bottom", collision: "none"}, source: null, change: null, close: null, focus: null, open: null, response: null, search: null, select: null}, requestIndex: 0, pending: 0, _create: function () {
        var t, i, s, n = this.element[0].nodeName.toLowerCase(), a = "textarea" === n, o = "input" === n;
        this.isMultiLine = a ? !0 : o ? !1 : this.element.prop("isContentEditable"), this.valueMethod = this.element[a || o ? "val" : "text"], this.isNewMenu = !0, this.element.addClass("ui-autocomplete-input").attr("autocomplete", "off"), this._on(this.element, {keydown: function (n) {
            if (this.element.prop("readOnly"))return t = !0, s = !0, i = !0, undefined;
            t = !1, s = !1, i = !1;
            var a = e.ui.keyCode;
            switch (n.keyCode) {
                case a.PAGE_UP:
                    t = !0, this._move("previousPage", n);
                    break;
                case a.PAGE_DOWN:
                    t = !0, this._move("nextPage", n);
                    break;
                case a.UP:
                    t = !0, this._keyEvent("previous", n);
                    break;
                case a.DOWN:
                    t = !0, this._keyEvent("next", n);
                    break;
                case a.ENTER:
                case a.NUMPAD_ENTER:
                    this.menu.active && (t = !0, n.preventDefault(), this.menu.select(n));
                    break;
                case a.TAB:
                    this.menu.active && this.menu.select(n);
                    break;
                case a.ESCAPE:
                    this.menu.element.is(":visible") && (this._value(this.term), this.close(n), n.preventDefault());
                    break;
                default:
                    i = !0, this._searchTimeout(n)
            }
        }, keypress: function (s) {
            if (t)return t = !1, (!this.isMultiLine || this.menu.element.is(":visible")) && s.preventDefault(), undefined;
            if (!i) {
                var n = e.ui.keyCode;
                switch (s.keyCode) {
                    case n.PAGE_UP:
                        this._move("previousPage", s);
                        break;
                    case n.PAGE_DOWN:
                        this._move("nextPage", s);
                        break;
                    case n.UP:
                        this._keyEvent("previous", s);
                        break;
                    case n.DOWN:
                        this._keyEvent("next", s)
                }
            }
        }, input: function (e) {
            return s ? (s = !1, e.preventDefault(), undefined) : (this._searchTimeout(e), undefined)
        }, focus: function () {
            this.selectedItem = null, this.previous = this._value()
        }, blur: function (e) {
            return this.cancelBlur ? (delete this.cancelBlur, undefined) : (clearTimeout(this.searching), this.close(e), this._change(e), undefined)
        }}), this._initSource(), this.menu = e("




© 2015 - 2024 Weber Informatics LLC | Privacy Policy