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
ac3b6f14
Commit
ac3b6f14
authored
Feb 22, 2018
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert switch into if statement
parent
6ce56d45
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
24 deletions
+27
-24
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+27
-24
No files found.
app/assets/javascripts/dispatcher.js
View file @
ac3b6f14
...
...
@@ -42,31 +42,34 @@ var Dispatcher;
});
});
switch
(
page
)
{
case
'
projects:merge_requests:index
'
:
case
'
projects:issues:index
'
:
case
'
projects:issues:show
'
:
case
'
projects:issues:new
'
:
case
'
projects:issues:edit
'
:
case
'
projects:merge_requests:creations:new
'
:
case
'
projects:merge_requests:creations:diffs
'
:
case
'
projects:merge_requests:edit
'
:
case
'
projects:merge_requests:show
'
:
case
'
projects:commit:show
'
:
case
'
projects:activity
'
:
case
'
projects:commits:show
'
:
case
'
projects:show
'
:
case
'
groups:show
'
:
case
'
projects:tree:show
'
:
case
'
projects:find_file:show
'
:
case
'
projects:blob:show
'
:
case
'
projects:blame:show
'
:
case
'
projects:network:show
'
:
case
'
projects:artifacts:browse
'
:
case
'
projects:artifacts:file
'
:
shortcut_handler
=
true
;
break
;
const
shortcutHandlerPages
=
[
'
projects:activity
'
,
'
projects:artifacts:browse
'
,
'
projects:artifacts:file
'
,
'
projects:blame:show
'
,
'
projects:blob:show
'
,
'
projects:commit:show
'
,
'
projects:commits:show
'
,
'
projects:find_file:show
'
,
'
projects:issues:edit
'
,
'
projects:issues:index
'
,
'
projects:issues:new
'
,
'
projects:issues:show
'
,
'
projects:merge_requests:creations:diffs
'
,
'
projects:merge_requests:creations:new
'
,
'
projects:merge_requests:edit
'
,
'
projects:merge_requests:index
'
,
'
projects:merge_requests:show
'
,
'
projects:network:show
'
,
'
projects:show
'
,
'
projects:tree:show
'
,
'
groups:show
'
,
];
if
(
shortcutHandlerPages
.
indexOf
(
page
)
!==
-
1
)
{
shortcut_handler
=
true
;
}
switch
(
path
[
0
])
{
case
'
admin
'
:
switch
(
path
[
1
])
{
...
...
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