debian-mirror-gitlab/app/assets/javascripts/shortcuts_dashboard_navigation.js.coffee

15 lines
654 B
CoffeeScript
Raw Normal View History

2015-04-26 09:18:37 +02:00
#= require shortcuts
class @ShortcutsDashboardNavigation extends Shortcuts
constructor: ->
super()
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'))
2015-04-26 09:18:37 +02:00
@findAndFollowLink: (selector) ->
link = $(selector).attr('href')
if link
window.location = link