You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2016/09/05 09:14:06 UTC

[2/3] incubator-ponymail git commit: don't swipe too fast

don't swipe too fast

scroll wheels without a click (or trackballs etc) might
swipe too fast, so add a delay to swiping.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/202887a8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/202887a8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/202887a8

Branch: refs/heads/coffee-and-cake
Commit: 202887a8974d8bdedcfdd6fb13fdbbe965b0a644
Parents: d725cd2
Author: Daniel Gruno <hu...@apache.org>
Authored: Mon Sep 5 11:13:44 2016 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Mon Sep 5 11:13:44 2016 +0200

----------------------------------------------------------------------
 site/js/coffee/listview_basic.coffee | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/202887a8/site/js/coffee/listview_basic.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/listview_basic.coffee b/site/js/coffee/listview_basic.coffee
index 1d84d06..2e20235 100644
--- a/site/js/coffee/listview_basic.coffee
+++ b/site/js/coffee/listview_basic.coffee
@@ -244,6 +244,7 @@ class BasicListView
         
     ### swipe: go to next or previous page of emails, depending on mouse wheel direction ###
     swipe: (e) ->
+        @lastSwipe = @lastSwipe || 0
         direction = ""
         if typeof e is 'string'
             direction = e
@@ -259,6 +260,11 @@ class BasicListView
         if ponymail_email_open.length > 0 or scrollBar
             return
         
+        ### Make sure we don't swipe too fast! ###
+        now = new Date().getTime()
+        if (now - @lastSwipe) < 100
+            return
+        
         if direction == 'down'
             ### Next page? ###
             if @listsize > (@pos+@rpp+1)
@@ -267,4 +273,4 @@ class BasicListView
             ### Previous page? ###
             if @pos > 0
                 @scroll(@rpp, Math.max(0,@pos-@rpp))
-                
\ No newline at end of file
+        @lastSwipe = now
\ No newline at end of file