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
Léo-Paul Géneau
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;
...
@@ -42,31 +42,34 @@ var Dispatcher;
});
});
});
});
switch
(
page
)
{
const
shortcutHandlerPages
=
[
case
'
projects:merge_requests:index
'
:
'
projects:activity
'
,
case
'
projects:issues:index
'
:
'
projects:artifacts:browse
'
,
case
'
projects:issues:show
'
:
'
projects:artifacts:file
'
,
case
'
projects:issues:new
'
:
'
projects:blame:show
'
,
case
'
projects:issues:edit
'
:
'
projects:blob:show
'
,
case
'
projects:merge_requests:creations:new
'
:
'
projects:commit:show
'
,
case
'
projects:merge_requests:creations:diffs
'
:
'
projects:commits:show
'
,
case
'
projects:merge_requests:edit
'
:
'
projects:find_file:show
'
,
case
'
projects:merge_requests:show
'
:
'
projects:issues:edit
'
,
case
'
projects:commit:show
'
:
'
projects:issues:index
'
,
case
'
projects:activity
'
:
'
projects:issues:new
'
,
case
'
projects:commits:show
'
:
'
projects:issues:show
'
,
case
'
projects:show
'
:
'
projects:merge_requests:creations:diffs
'
,
case
'
groups:show
'
:
'
projects:merge_requests:creations:new
'
,
case
'
projects:tree:show
'
:
'
projects:merge_requests:edit
'
,
case
'
projects:find_file:show
'
:
'
projects:merge_requests:index
'
,
case
'
projects:blob:show
'
:
'
projects:merge_requests:show
'
,
case
'
projects:blame:show
'
:
'
projects:network:show
'
,
case
'
projects:network:show
'
:
'
projects:show
'
,
case
'
projects:artifacts:browse
'
:
'
projects:tree:show
'
,
case
'
projects:artifacts:file
'
:
'
groups:show
'
,
shortcut_handler
=
true
;
];
break
;
if
(
shortcutHandlerPages
.
indexOf
(
page
)
!==
-
1
)
{
shortcut_handler
=
true
;
}
}
switch
(
path
[
0
])
{
switch
(
path
[
0
])
{
case
'
admin
'
:
case
'
admin
'
:
switch
(
path
[
1
])
{
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