瀏覽代碼

Improve ListFocus behavior

Thibaut 11 年之前
父節點
當前提交
25efa5522e
共有 1 個文件被更改,包括 8 次插入4 次删除
  1. 8 4
      assets/javascripts/views/list/list_focus.coffee

+ 8 - 4
assets/javascripts/views/list/list_focus.coffee

@@ -37,8 +37,10 @@ class app.views.ListFocus extends app.View
       else if next.tagName is 'SPAN' # pagination link
         $.click(next)
         @findNext cursor
-      else # sub-list
+      else if next.tagName is 'DIV' # sub-list
         @findFirst(next) or @findNext(next)
+      else if next.tagName is 'H6' # title
+        @findNext(next)
     else if cursor.parentElement isnt @el
       @findNext cursor.parentElement
 
@@ -58,8 +60,10 @@ class app.views.ListFocus extends app.View
       else if prev.tagName is 'SPAN' # pagination link
         $.click(prev)
         @findPrev cursor
-      else # sub-list
+      else if prev.tagName is 'DIV' # sub-list
         @findLast(prev) or @findPrev(prev)
+      else if prev.tagName is 'H6' # title
+        @findPrev(prev)
     else if cursor.parentElement isnt @el
       @findPrev cursor.parentElement
 
@@ -68,9 +72,9 @@ class app.views.ListFocus extends app.View
 
     if last.tagName is 'A'
       last
-    else if last.tagName is 'SPAN' # pagination link
+    else if last.tagName is 'SPAN' or last.tagName is 'H6' # pagination link or title
       @findPrev last
-    else # sub-list
+    else if last.tagName is 'DIV' # sub-list
       @findLast last
 
   onDown: =>