Skip to content

Commit 852e94b

Browse files
Update jquery.autocomplete.js
Removed commented out deprecated code
1 parent 535ed6b commit 852e94b

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

src/jquery.autocomplete.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@
127127
}
128128

129129
function _transformResult(response) {
130-
// return typeof response === 'string' ? $.parseJSON(response) : response;
131130
return typeof response === 'string' ? JSON.parse(response) : response;
132131
}
133132

@@ -527,7 +526,6 @@
527526
return value;
528527
}
529528
parts = value.split(delimiter);
530-
// return $.trim(parts[parts.length - 1]);
531529
return parts[parts.length - 1].trim();
532530
},
533531

@@ -569,7 +567,6 @@
569567

570568
params = options.ignoreParams ? null : options.params;
571569

572-
// if ($.isFunction(options.lookup)) {
573570
if (typeof options.lookup === 'function') {
574571
options.lookup(q, function (data) {
575572
that.suggestions = data.suggestions;
@@ -582,7 +579,6 @@
582579
if (that.isLocal) {
583580
response = that.getSuggestionsLocal(q);
584581
} else {
585-
// if ($.isFunction(serviceUrl)) {
586582
if (typeof serviceUrl === 'function') {
587583
serviceUrl = serviceUrl.call(that.element, q);
588584
}
@@ -643,7 +639,6 @@
643639
var that = this,
644640
container = $(that.suggestionsContainer);
645641

646-
// if ($.isFunction(that.options.onHide) && that.visible) {
647642
if ((typeof that.options.onHide === 'function') && that.visible) {
648643
that.options.onHide.call(that.element, container);
649644
}
@@ -715,7 +710,6 @@
715710
noSuggestionsContainer.detach();
716711
container.html(html);
717712

718-
// if ($.isFunction(beforeRender)) {
719713
if (typeof beforeRender === 'function') {
720714
beforeRender.call(that.element, container, that.suggestions);
721715
}
@@ -753,7 +747,6 @@
753747
container.empty();
754748
container.append(noSuggestionsContainer);
755749

756-
// if ($.isFunction(beforeRender)) {
757750
if (typeof beforeRender === 'function') {
758751
beforeRender.call(that.element, container, that.suggestions);
759752
}
@@ -814,7 +807,6 @@
814807
if (that.hintValue !== hintValue) {
815808
that.hintValue = hintValue;
816809
that.hint = suggestion;
817-
// if ($.isFunction(onHintCallback)) {
818810
if (typeof onHintCallback === 'function') {
819811
onHintCallback.call(that.element, hintValue);
820812
}
@@ -833,7 +825,6 @@
833825
},
834826

835827
validateOrientation: function (orientation, fallback) {
836-
// orientation = $.trim(orientation || '').toLowerCase();
837828
orientation = (orientation || '').trim().toLowerCase();
838829

839830
if ($.inArray(orientation, ['auto', 'bottom', 'top']) === -1) {
@@ -983,7 +974,6 @@
983974
that.suggestions = [];
984975
that.selection = suggestion;
985976

986-
// if ($.isFunction(onSelectCallback)) {
987977
if (typeof onSelectCallback === 'function') {
988978
onSelectCallback.call(that.element, suggestion);
989979
}

0 commit comments

Comments
 (0)