ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject incubator-ponymail git commit: allow page up/down to move list view
Date Sun, 04 Sep 2016 17:48:44 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/coffee-and-cake f86d3ec6d -> ad6bdb5b1


allow page up/down to move list view


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

Branch: refs/heads/coffee-and-cake
Commit: ad6bdb5b1c2b17f65d9dfe54d645b3b01fc36b22
Parents: f86d3ec
Author: Daniel Gruno <humbedooh@apache.org>
Authored: Sun Sep 4 19:48:31 2016 +0200
Committer: Daniel Gruno <humbedooh@apache.org>
Committed: Sun Sep 4 19:48:31 2016 +0200

----------------------------------------------------------------------
 site/js/coffee/keyboard_shortcuts.coffee | 11 +++++++++--
 site/js/coffee/listview_basic.coffee     |  6 +++++-
 2 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/ad6bdb5b/site/js/coffee/keyboard_shortcuts.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/keyboard_shortcuts.coffee b/site/js/coffee/keyboard_shortcuts.coffee
index ddb3129..f65f5ef 100644
--- a/site/js/coffee/keyboard_shortcuts.coffee
+++ b/site/js/coffee/keyboard_shortcuts.coffee
@@ -55,7 +55,7 @@ dealWithKeyboard = (e) ->
                     
                     
     ### Make sure the below shortcuts don't interfere with normal operations ###
-    if splash.style.display != 'block' and document.activeElement.nodeName != 'INPUT' and
not e.ctrlKey
+    if splash and splash.style.display != 'block' and document.activeElement.nodeName !=
'INPUT' and not e.ctrlKey
         ### H key: show help ###
         if (e.keyCode == 72)
             popup("Keyboard shortcuts",
@@ -82,6 +82,13 @@ dealWithKeyboard = (e) ->
             if get('q')
                 get('q').focus()
 
-
+    ### Page Up - scroll list view if possible ###
+    if e.keyCode == 33 and ponymail_current_listview
+        ponymail_current_listview.swipe('up')
+    
+    ### Page Down - scroll list view if possible ###
+    if e.keyCode == 34 and ponymail_current_listview
+        ponymail_current_listview.swipe('down')
+    
 ### Add listener for keys (mostly for escape key for hiding stuff) ###
 window.addEventListener("keyup", dealWithKeyboard, false);

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/ad6bdb5b/site/js/coffee/listview_basic.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/listview_basic.coffee b/site/js/coffee/listview_basic.coffee
index 2b5665e..8a27d80 100644
--- a/site/js/coffee/listview_basic.coffee
+++ b/site/js/coffee/listview_basic.coffee
@@ -238,7 +238,11 @@ class BasicListView
         
     ### swipe: go to next or previous page of emails, depending on mouse wheel direction
###
     swipe: (e) ->
-        direction = if ((e.wheelDelta || -e.detail) < 0) then 'down' else 'up'
+        direction = ""
+        if typeof e is 'string'
+            direction = e
+        else
+            direction = if ((e.wheelDelta || -e.detail) < 0) then 'down' else 'up'
         style = document.body.currentStyle || window.getComputedStyle(document.body, "")
         
         ### Use the footer to determine whether scrollbar is present or not ###


Mime
View raw message