shortcuts_dashboard_navigation.js.coffee 609 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#= require shortcuts

class @ShortcutsDashboardNavigation extends Shortcuts
 constructor: ->
   super()
   Mousetrap.bind('g a', -> ShortcutsDashboardNavigation.findAndollowLink('.shortcuts-activity'))
   Mousetrap.bind('g p', -> ShortcutsDashboardNavigation.findAndollowLink('.shortcuts-projects'))
   Mousetrap.bind('g i', -> ShortcutsDashboardNavigation.findAndollowLink('.shortcuts-issues'))
   Mousetrap.bind('g m', -> ShortcutsDashboardNavigation.findAndollowLink('.shortcuts-merge_requests'))

 @findAndollowLink: (selector) ->
   link = $(selector).attr('href')
   if link
     window.location = link