diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2014-08-21 12:14:31 +0400 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2014-09-01 13:49:17 +0400 |
commit | 0cbc19f9449ffc6e624c0b7e22ea837468658377 (patch) | |
tree | e48375611c09c38a14f45adecbe31309f308798b /app/assets/javascripts/shortcuts_navigation.coffee | |
parent | 174c00cf2c026a3bdc61d94b45195a5e5c99202f (diff) |
Awesome shortcuts for GitLab
Diffstat (limited to 'app/assets/javascripts/shortcuts_navigation.coffee')
-rw-r--r-- | app/assets/javascripts/shortcuts_navigation.coffee | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/assets/javascripts/shortcuts_navigation.coffee b/app/assets/javascripts/shortcuts_navigation.coffee new file mode 100644 index 00000000000..e24a74ea9b6 --- /dev/null +++ b/app/assets/javascripts/shortcuts_navigation.coffee @@ -0,0 +1,20 @@ +#= require shortcuts + +class @ShortcutsNavigation extends Shortcuts + constructor: -> + super() + Mousetrap.bind('g a', -> ShortcutsNavigation.findAndollowLink('.shortcuts-activity')) + Mousetrap.bind('g f', -> ShortcutsNavigation.findAndollowLink('.shortcuts-tree')) + Mousetrap.bind('g c', -> ShortcutsNavigation.findAndollowLink('.shortcuts-commits')) + Mousetrap.bind('g n', -> ShortcutsNavigation.findAndollowLink('.shortcuts-network')) + Mousetrap.bind('g g', -> ShortcutsNavigation.findAndollowLink('.shortcuts-graphs')) + Mousetrap.bind('g i', -> ShortcutsNavigation.findAndollowLink('.shortcuts-issues')) + Mousetrap.bind('g m', -> ShortcutsNavigation.findAndollowLink('.shortcuts-merge_requests')) + Mousetrap.bind('g w', -> ShortcutsNavigation.findAndollowLink('.shortcuts-wiki')) + Mousetrap.bind('g s', -> ShortcutsNavigation.findAndollowLink('.shortcuts-snippets')) + @enabledHelp.push('.hidden-shortcut.project') + + @findAndollowLink: (selector) -> + link = $(selector).attr('href') + if link + window.location = link |