|
127 | 127 | } |
128 | 128 |
|
129 | 129 | function _transformResult(response) { |
130 | | -// return typeof response === 'string' ? $.parseJSON(response) : response; |
131 | 130 | return typeof response === 'string' ? JSON.parse(response) : response; |
132 | 131 | } |
133 | 132 |
|
|
527 | 526 | return value; |
528 | 527 | } |
529 | 528 | parts = value.split(delimiter); |
530 | | -// return $.trim(parts[parts.length - 1]); |
531 | 529 | return parts[parts.length - 1].trim(); |
532 | 530 | }, |
533 | 531 |
|
|
569 | 567 |
|
570 | 568 | params = options.ignoreParams ? null : options.params; |
571 | 569 |
|
572 | | -// if ($.isFunction(options.lookup)) { |
573 | 570 | if (typeof options.lookup === 'function') { |
574 | 571 | options.lookup(q, function (data) { |
575 | 572 | that.suggestions = data.suggestions; |
|
582 | 579 | if (that.isLocal) { |
583 | 580 | response = that.getSuggestionsLocal(q); |
584 | 581 | } else { |
585 | | -// if ($.isFunction(serviceUrl)) { |
586 | 582 | if (typeof serviceUrl === 'function') { |
587 | 583 | serviceUrl = serviceUrl.call(that.element, q); |
588 | 584 | } |
|
643 | 639 | var that = this, |
644 | 640 | container = $(that.suggestionsContainer); |
645 | 641 |
|
646 | | -// if ($.isFunction(that.options.onHide) && that.visible) { |
647 | 642 | if ((typeof that.options.onHide === 'function') && that.visible) { |
648 | 643 | that.options.onHide.call(that.element, container); |
649 | 644 | } |
|
715 | 710 | noSuggestionsContainer.detach(); |
716 | 711 | container.html(html); |
717 | 712 |
|
718 | | -// if ($.isFunction(beforeRender)) { |
719 | 713 | if (typeof beforeRender === 'function') { |
720 | 714 | beforeRender.call(that.element, container, that.suggestions); |
721 | 715 | } |
|
753 | 747 | container.empty(); |
754 | 748 | container.append(noSuggestionsContainer); |
755 | 749 |
|
756 | | -// if ($.isFunction(beforeRender)) { |
757 | 750 | if (typeof beforeRender === 'function') { |
758 | 751 | beforeRender.call(that.element, container, that.suggestions); |
759 | 752 | } |
|
814 | 807 | if (that.hintValue !== hintValue) { |
815 | 808 | that.hintValue = hintValue; |
816 | 809 | that.hint = suggestion; |
817 | | -// if ($.isFunction(onHintCallback)) { |
818 | 810 | if (typeof onHintCallback === 'function') { |
819 | 811 | onHintCallback.call(that.element, hintValue); |
820 | 812 | } |
|
833 | 825 | }, |
834 | 826 |
|
835 | 827 | validateOrientation: function (orientation, fallback) { |
836 | | -// orientation = $.trim(orientation || '').toLowerCase(); |
837 | 828 | orientation = (orientation || '').trim().toLowerCase(); |
838 | 829 |
|
839 | 830 | if ($.inArray(orientation, ['auto', 'bottom', 'top']) === -1) { |
|
983 | 974 | that.suggestions = []; |
984 | 975 | that.selection = suggestion; |
985 | 976 |
|
986 | | -// if ($.isFunction(onSelectCallback)) { |
987 | 977 | if (typeof onSelectCallback === 'function') { |
988 | 978 | onSelectCallback.call(that.element, suggestion); |
989 | 979 | } |
|
0 commit comments