Revert "keep loading more results until there are enough to cause a scroll. closes #164 closes #164 closes #74"
This reverts commit ff03dbcacaf4f756c872c17282c936e03b9bede6.
This commit is contained in:
parent
ff03dbcaca
commit
ea28fa4fe4
@ -81,7 +81,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (k.metaKey) return true;
|
if (k.metaKey) return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
isFunctionKey: function (k) {
|
isFunctionKey: function (k) {
|
||||||
@ -863,6 +863,7 @@
|
|||||||
var results = this.results,
|
var results = this.results,
|
||||||
more = results.find("li.select2-more-results"),
|
more = results.find("li.select2-more-results"),
|
||||||
below, // pixels the element is below the scroll fold, below==0 is when the element is starting to be visible
|
below, // pixels the element is below the scroll fold, below==0 is when the element is starting to be visible
|
||||||
|
offset = -1, // index of first element without data
|
||||||
page = this.resultsPage + 1,
|
page = this.resultsPage + 1,
|
||||||
self=this,
|
self=this,
|
||||||
term=this.search.val(),
|
term=this.search.val(),
|
||||||
@ -884,8 +885,8 @@
|
|||||||
|
|
||||||
if (data.more===true) {
|
if (data.more===true) {
|
||||||
more.detach();
|
more.detach();
|
||||||
results.children().filter(":last").append("<li class='select2-more-results'>" + opts.formatLoadingNextSet(self.resultsPage) + "</li>");
|
results.children().filter(":last").append(more);
|
||||||
window.setTimeout(function() { self.loadMoreIfNeeded(); }, 10);
|
more.removeClass("select2-active");
|
||||||
} else {
|
} else {
|
||||||
more.remove();
|
more.remove();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user