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

27 lines
1.3 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'));
Mousetrap.bind('g e', () => findAndFollowLink('.shortcuts-project-activity'));
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 t', () => findAndFollowLink('.shortcuts-todos'));
Mousetrap.bind('g w', () => findAndFollowLink('.shortcuts-wiki'));
Mousetrap.bind('g s', () => findAndFollowLink('.shortcuts-snippets'));
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');
}
}