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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
4a878e1d
Commit
4a878e1d
authored
Feb 05, 2016
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `j` and `k` shortcuts
parent
2e8fe0bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
app/assets/javascripts/shortcuts_issuable.coffee
app/assets/javascripts/shortcuts_issuable.coffee
+19
-0
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+2
-2
No files found.
app/assets/javascripts/shortcuts_issuable.coffee
View file @
4a878e1d
...
...
@@ -16,12 +16,31 @@ class @ShortcutsIssuable extends ShortcutsNavigation
@
replyWithSelectedText
()
return
false
)
Mousetrap
.
bind
(
'j'
,
=>
@
prevIssue
()
return
false
)
Mousetrap
.
bind
(
'k'
,
=>
@
nextIssue
()
return
false
)
if
isMergeRequest
@
enabledHelp
.
push
(
'.hidden-shortcut.merge_requests'
)
else
@
enabledHelp
.
push
(
'.hidden-shortcut.issues'
)
prevIssue
:
->
$prevBtn
=
$
(
'.prev-btn'
)
if
not
$prevBtn
.
hasClass
(
'disabled'
)
Turbolinks
.
visit
(
$prevBtn
.
attr
(
'href'
))
nextIssue
:
->
$nextBtn
=
$
(
'.next-btn'
)
if
not
$nextBtn
.
hasClass
(
'disabled'
)
Turbolinks
.
visit
(
$nextBtn
.
attr
(
'href'
))
replyWithSelectedText
:
->
if
window
.
getSelection
selected
=
window
.
getSelection
().
toString
()
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
4a878e1d
...
...
@@ -13,12 +13,12 @@
=
icon
(
'angle-double-right'
)
.issuable-nav.pull-right.btn-group
{
role:
'group'
,
"aria-label"
=>
'...'
}
-
if
has_prev_issuable?
(
@project
,
issuable
.
id
)
=
link_to
'Prev'
,
issuable_link_prev
(
@project
,
issuable
),
class:
'btn btn-default'
=
link_to
'Prev'
,
issuable_link_prev
(
@project
,
issuable
),
class:
'btn btn-default
prev-btn
'
-
else
%a
.btn.btn-default.disabled
{
href:
'#'
}
Prev
-
if
has_next_issuable?
(
@project
,
issuable
.
id
)
=
link_to
'Next'
,
issuable_link_next
(
@project
,
issuable
),
class:
'btn btn-default'
=
link_to
'Next'
,
issuable_link_next
(
@project
,
issuable
),
class:
'btn btn-default
next-btn
'
-
else
%a
.btn.btn-default.disabled
{
href:
'#'
}
Next
...
...
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