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
91de6e25
Commit
91de6e25
authored
Apr 12, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Toggle help modal
parent
7f153077
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
20 deletions
+23
-20
app/assets/javascripts/shortcuts.js.coffee
app/assets/javascripts/shortcuts.js.coffee
+23
-20
No files found.
app/assets/javascripts/shortcuts.js.coffee
View file @
91de6e25
...
@@ -2,21 +2,25 @@ class @Shortcuts
...
@@ -2,21 +2,25 @@ class @Shortcuts
constructor
:
->
constructor
:
->
@
enabledHelp
=
[]
@
enabledHelp
=
[]
Mousetrap
.
reset
()
Mousetrap
.
reset
()
Mousetrap
.
bind
(
'?'
,
@
selectiv
eHelp
)
Mousetrap
.
bind
(
'?'
,
@
onToggl
eHelp
)
Mousetrap
.
bind
(
's'
,
Shortcuts
.
focusSearch
)
Mousetrap
.
bind
(
's'
,
Shortcuts
.
focusSearch
)
Mousetrap
.
bind
([
'ctrl+shift+p'
,
'command+shift+p'
],
@
toggleMarkdownPreview
)
Mousetrap
.
bind
([
'ctrl+shift+p'
,
'command+shift+p'
],
@
toggleMarkdownPreview
)
Mousetrap
.
bind
(
't'
,
->
Turbolinks
.
visit
(
findFileURL
))
if
findFileURL
?
Mousetrap
.
bind
(
't'
,
->
Turbolinks
.
visit
(
findFileURL
))
if
findFileURL
?
selectiveHelp
:
(
e
)
=>
onToggleHelp
:
(
e
)
=>
Shortcuts
.
showHelp
(
e
,
@
enabledHelp
)
e
.
preventDefault
()
@
toggleHelp
(
@
enabledHelp
)
toggleMarkdownPreview
:
(
e
)
=>
toggleMarkdownPreview
:
(
e
)
=>
$
(
document
).
triggerHandler
(
'markdown-preview:toggle'
,
[
e
])
$
(
document
).
triggerHandler
(
'markdown-preview:toggle'
,
[
e
])
@
showHelp
:
(
e
,
location
)
->
toggleHelp
:
(
location
)
->
if
$
(
'#modal-shortcuts'
).
length
>
0
$modal
=
$
(
'#modal-shortcuts'
)
$
(
'#modal-shortcuts'
).
modal
(
'show'
)
else
if
$modal
.
length
$modal
.
modal
(
'toggle'
)
return
url
=
'/help/shortcuts'
url
=
'/help/shortcuts'
url
=
gon
.
relative_url_root
+
url
if
gon
.
relative_url_root
?
url
=
gon
.
relative_url_root
+
url
if
gon
.
relative_url_root
?
$
.
ajax
(
$
.
ajax
(
...
@@ -29,7 +33,6 @@ class @Shortcuts
...
@@ -29,7 +33,6 @@ class @Shortcuts
$
(
'.hidden-shortcut'
).
show
()
$
(
'.hidden-shortcut'
).
show
()
$
(
'.js-more-help-button'
).
remove
()
$
(
'.js-more-help-button'
).
remove
()
)
)
e
.
preventDefault
()
@
focusSearch
:
(
e
)
->
@
focusSearch
:
(
e
)
->
$
(
'#search'
).
focus
()
$
(
'#search'
).
focus
()
...
...
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