Przeglądaj źródła

Speed up smooth scrolling a bit

Thibaut Courouble 9 lat temu
rodzic
commit
29829ac1ce
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      assets/javascripts/lib/util.coffee

+ 2 - 2
assets/javascripts/lib/util.coffee

@@ -234,13 +234,13 @@ $.smoothScroll = (el, end) ->
 
   if smoothScroll
     newDistance = smoothEnd - smoothStart
-    smoothDuration += Math.min 400, Math.abs(smoothDistance - newDistance)
+    smoothDuration += Math.min 300, Math.abs(smoothDistance - newDistance)
     smoothDistance = newDistance
     return
 
   smoothStart = el.scrollTop
   smoothDistance = smoothEnd - smoothStart
-  smoothDuration = Math.min 400, Math.abs(smoothDistance)
+  smoothDuration = Math.min 300, Math.abs(smoothDistance)
   startTime = Date.now()
 
   smoothScroll = ->