Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2cf82d19
Commit
2cf82d19
authored
Nov 02, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for `l`, `e` and `r` keyboard shortcuts in Epic
parent
60ed8eb8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
0 deletions
+36
-0
ee/app/assets/javascripts/behaviors/shortcuts/shortcuts_epic.js
.../assets/javascripts/behaviors/shortcuts/shortcuts_epic.js
+26
-0
ee/app/assets/javascripts/epics/sidebar/components/sidebar_app.vue
...sets/javascripts/epics/sidebar/components/sidebar_app.vue
+8
-0
ee/app/assets/javascripts/pages/groups/epics/show/index.js
ee/app/assets/javascripts/pages/groups/epics/show/index.js
+2
-0
No files found.
ee/app/assets/javascripts/behaviors/shortcuts/shortcuts_epic.js
0 → 100644
View file @
2cf82d19
import
$
from
'
jquery
'
;
import
Mousetrap
from
'
mousetrap
'
;
import
Cookies
from
'
js-cookie
'
;
import
ShortcutsIssuable
from
'
~/behaviors/shortcuts/shortcuts_issuable
'
;
export
default
class
ShortcutsEpic
extends
ShortcutsIssuable
{
constructor
()
{
super
();
const
$issuableSidebar
=
$
(
'
.js-issuable-update
'
);
Mousetrap
.
bind
(
'
l
'
,
()
=>
ShortcutsEpic
.
openSidebarDropdown
(
$issuableSidebar
.
find
(
'
.js-labels-block
'
)),
);
Mousetrap
.
bind
(
'
r
'
,
ShortcutsIssuable
.
replyWithSelectedText
);
Mousetrap
.
bind
(
'
e
'
,
ShortcutsIssuable
.
editIssue
);
}
static
openSidebarDropdown
(
$block
)
{
if
(
Cookies
.
get
(
'
collapsed_gutter
'
)
===
'
true
'
)
{
document
.
dispatchEvent
(
new
Event
(
'
toggleSidebarRevealLabelsDropdown
'
));
}
else
{
$block
.
find
(
'
.js-sidebar-dropdown-toggle
'
).
trigger
(
'
click
'
);
}
}
}
ee/app/assets/javascripts/epics/sidebar/components/sidebar_app.vue
View file @
2cf82d19
...
...
@@ -226,9 +226,17 @@ export default {
},
mounted
()
{
eventHub
.
$on
(
'
toggleSidebar
'
,
this
.
toggleSidebar
);
document
.
addEventListener
(
'
toggleSidebarRevealLabelsDropdown
'
,
this
.
toggleSidebarRevealLabelsDropdown
,
);
},
beforeDestroy
()
{
eventHub
.
$off
(
'
toggleSidebar
'
,
this
.
toggleSidebar
);
document
.
removeEventListener
(
'
toggleSidebarRevealLabelsDropdown
'
,
this
.
toggleSidebarRevealLabelsDropdown
,
);
},
methods
:
{
getDateValidity
(
startDate
,
endDate
)
{
...
...
ee/app/assets/javascripts/pages/groups/epics/show/index.js
View file @
2cf82d19
import
ZenMode
from
'
~/zen_mode
'
;
import
initEpicShow
from
'
ee/epics/epic_show/epic_show_bundle
'
;
import
ShortcutsEpic
from
'
ee/behaviors/shortcuts/shortcuts_epic
'
;
import
'
~/notes/index
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
new
ZenMode
();
// eslint-disable-line no-new
initEpicShow
();
new
ShortcutsEpic
();
// eslint-disable-line no-new
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment