debian-mirror-gitlab/app/assets/javascripts/shortcuts_navigation.js

29 lines
1.5 KiB
JavaScript
Raw Normal View History

2018-03-17 18:26:18 +05:30
import Mousetrap from 'mousetrap';
2017-09-10 17:25:29 +05:30
import findAndFollowLink from './shortcuts_dashboard_navigation';
2018-03-17 18:26:18 +05:30
import Shortcuts from './shortcuts';
2016-09-13 17:45:13 +05:30
2018-03-17 18:26:18 +05:30
export default class ShortcutsNavigation extends Shortcuts {
constructor() {
super();
2016-09-13 17:45:13 +05:30
2018-03-17 18:26:18 +05:30
Mousetrap.bind('g p', () => findAndFollowLink('.shortcuts-project'));
2018-11-08 19:23:39 +05:30
Mousetrap.bind('g v', () => findAndFollowLink('.shortcuts-project-activity'));
2018-03-17 18:26:18 +05:30
Mousetrap.bind('g f', () => findAndFollowLink('.shortcuts-tree'));
Mousetrap.bind('g c', () => findAndFollowLink('.shortcuts-commits'));
Mousetrap.bind('g j', () => findAndFollowLink('.shortcuts-builds'));
Mousetrap.bind('g n', () => findAndFollowLink('.shortcuts-network'));
Mousetrap.bind('g d', () => findAndFollowLink('.shortcuts-repository-charts'));
Mousetrap.bind('g i', () => findAndFollowLink('.shortcuts-issues'));
Mousetrap.bind('g b', () => findAndFollowLink('.shortcuts-issue-boards'));
Mousetrap.bind('g m', () => findAndFollowLink('.shortcuts-merge_requests'));
Mousetrap.bind('g w', () => findAndFollowLink('.shortcuts-wiki'));
Mousetrap.bind('g s', () => findAndFollowLink('.shortcuts-snippets'));
2018-11-08 19:23:39 +05:30
Mousetrap.bind('g k', () => findAndFollowLink('.shortcuts-kubernetes'));
Mousetrap.bind('g e', () => findAndFollowLink('.shortcuts-environments'));
Mousetrap.bind('g l', () => findAndFollowLink('.shortcuts-metrics'));
2018-03-17 18:26:18 +05:30
Mousetrap.bind('i', () => findAndFollowLink('.shortcuts-new-issue'));
2016-09-13 17:45:13 +05:30
2018-03-17 18:26:18 +05:30
this.enabledHelp.push('.hidden-shortcut.project');
}
}