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
2aa29872
Commit
2aa29872
authored
Sep 13, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move performance_bar setup to dispatcher to main.js
parent
05f403cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
8 deletions
+2
-8
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+0
-8
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+2
-0
No files found.
app/assets/javascripts/dispatcher.js
View file @
2aa29872
...
@@ -4,7 +4,6 @@ import $ from 'jquery';
...
@@ -4,7 +4,6 @@ import $ from 'jquery';
import
GfmAutoComplete
from
'
./gfm_auto_complete
'
;
import
GfmAutoComplete
from
'
./gfm_auto_complete
'
;
import
{
convertPermissionToBoolean
}
from
'
./lib/utils/common_utils
'
;
import
{
convertPermissionToBoolean
}
from
'
./lib/utils/common_utils
'
;
import
Shortcuts
from
'
./shortcuts
'
;
import
Shortcuts
from
'
./shortcuts
'
;
import
performanceBar
from
'
./performance_bar
'
;
function
initPageShortcuts
(
page
)
{
function
initPageShortcuts
(
page
)
{
const
pagesWithCustomShortcuts
=
[
const
pagesWithCustomShortcuts
=
[
...
@@ -55,17 +54,10 @@ function initGFMInput() {
...
@@ -55,17 +54,10 @@ function initGFMInput() {
});
});
}
}
function
initPerformanceBar
()
{
if
(
document
.
querySelector
(
'
#js-peek
'
))
{
performanceBar
({
container
:
'
#js-peek
'
});
}
}
export
default
()
=>
{
export
default
()
=>
{
const
page
=
$
(
'
body
'
).
attr
(
'
data-page
'
);
const
page
=
$
(
'
body
'
).
attr
(
'
data-page
'
);
if
(
page
)
{
if
(
page
)
{
initPageShortcuts
(
page
);
initPageShortcuts
(
page
);
initGFMInput
();
initGFMInput
();
initPerformanceBar
();
}
}
};
};
app/assets/javascripts/main.js
View file @
2aa29872
...
@@ -28,6 +28,7 @@ import './frequent_items';
...
@@ -28,6 +28,7 @@ import './frequent_items';
import
initBreadcrumbs
from
'
./breadcrumb
'
;
import
initBreadcrumbs
from
'
./breadcrumb
'
;
import
initDispatcher
from
'
./dispatcher
'
;
import
initDispatcher
from
'
./dispatcher
'
;
import
initUsagePingConsent
from
'
./usage_ping_consent
'
;
import
initUsagePingConsent
from
'
./usage_ping_consent
'
;
import
initPerformanceBar
from
'
./performance_bar
'
;
import
initSearchAutocomplete
from
'
./search_autocomplete
'
;
import
initSearchAutocomplete
from
'
./search_autocomplete
'
;
import
GlFieldErrors
from
'
./gl_field_errors
'
;
import
GlFieldErrors
from
'
./gl_field_errors
'
;
...
@@ -80,6 +81,7 @@ document.addEventListener('DOMContentLoaded', () => {
...
@@ -80,6 +81,7 @@ document.addEventListener('DOMContentLoaded', () => {
initUsagePingConsent
();
initUsagePingConsent
();
if
(
document
.
querySelector
(
'
.search
'
))
initSearchAutocomplete
();
if
(
document
.
querySelector
(
'
.search
'
))
initSearchAutocomplete
();
if
(
document
.
querySelector
(
'
#js-peek
'
))
initPerformanceBar
({
container
:
'
#js-peek
'
});
// Set the default path for all cookies to GitLab's root directory
// Set the default path for all cookies to GitLab's root directory
Cookies
.
defaults
.
path
=
gon
.
relative_url_root
||
'
/
'
;
Cookies
.
defaults
.
path
=
gon
.
relative_url_root
||
'
/
'
;
...
...
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