Parcourir la source

Merge pull request #697 from agworld/add-load-more-padding-option

add loadMorePadding option
Igor Vaynberg il y a 12 ans
Parent
commit
5f2828098e
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      select2.js

+ 2 - 1
select2.js

@@ -1176,7 +1176,7 @@ the specific language governing permissions and limitations under the Apache Lic
             if (more.length === 0) return;
             below = more.offset().top - results.offset().top - results.height();
 
-            if (below <= 0) {
+            if (below <= this.opts.loadMorePadding) {
                 more.addClass("select2-active");
                 this.opts.query({
                         term: term,
@@ -2411,6 +2411,7 @@ the specific language governing permissions and limitations under the Apache Lic
     // plugin defaults, accessible to users
     $.fn.select2.defaults = {
         width: "copy",
+        loadMorePadding: 0,
         closeOnSelect: true,
         openOnEnter: true,
         containerCss: {},