Explorar o código

Reuse result of previous calcualtion

This closes https://github.com/select2/select2/pull/4155.
Vasyl Zuzyak %!s(int64=9) %!d(string=hai) anos
pai
achega
e3f9466d8b
Modificáronse 1 ficheiros con 1 adicións e 5 borrados
  1. 1 5
      src/js/select2/results.js

+ 1 - 5
src/js/select2/results.js

@@ -397,11 +397,7 @@ define([
       this.$results.on('mousewheel', function (e) {
         var top = self.$results.scrollTop();
 
-        var bottom = (
-          self.$results.get(0).scrollHeight -
-          self.$results.scrollTop() +
-          e.deltaY
-        );
+        var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
 
         var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
         var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();