shortcuts_dashboard_navigation.js.coffee 654 Bytes
Newer Older
1 2 3 4 5
#= require shortcuts

class @ShortcutsDashboardNavigation extends Shortcuts
 constructor: ->
   super()
6 7 8 9
   Mousetrap.bind('g a', -> ShortcutsDashboardNavigation.findAndFollowLink('.dashboard-shortcuts-activity'))
   Mousetrap.bind('g i', -> ShortcutsDashboardNavigation.findAndFollowLink('.dashboard-shortcuts-issues'))
   Mousetrap.bind('g m', -> ShortcutsDashboardNavigation.findAndFollowLink('.dashboard-shortcuts-merge_requests'))
   Mousetrap.bind('g p', -> ShortcutsDashboardNavigation.findAndFollowLink('.dashboard-shortcuts-projects'))
10

11
 @findAndFollowLink: (selector) ->
12 13 14
   link = $(selector).attr('href')
   if link
     window.location = link