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
Boxiang Sun
gitlab-ce
Commits
de07384b
Commit
de07384b
authored
May 06, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prettify main.js
parent
5728b123
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
15 deletions
+30
-15
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+30
-15
No files found.
app/assets/javascripts/main.js
View file @
de07384b
...
...
@@ -52,10 +52,14 @@ document.addEventListener('beforeunload', () => {
});
window
.
addEventListener
(
'
hashchange
'
,
handleLocationHash
);
window
.
addEventListener
(
'
load
'
,
function
onLoad
()
{
window
.
removeEventListener
(
'
load
'
,
onLoad
,
false
);
handleLocationHash
();
},
false
);
window
.
addEventListener
(
'
load
'
,
function
onLoad
()
{
window
.
removeEventListener
(
'
load
'
,
onLoad
,
false
);
handleLocationHash
();
},
false
,
);
gl
.
lazyLoader
=
new
LazyLoader
({
scrollContainer
:
window
,
...
...
@@ -89,9 +93,7 @@ document.addEventListener('DOMContentLoaded', () => {
if
(
bootstrapBreakpoint
===
'
xs
'
)
{
const
$rightSidebar
=
$
(
'
aside.right-sidebar, .layout-page
'
);
$rightSidebar
.
removeClass
(
'
right-sidebar-expanded
'
)
.
addClass
(
'
right-sidebar-collapsed
'
);
$rightSidebar
.
removeClass
(
'
right-sidebar-expanded
'
).
addClass
(
'
right-sidebar-collapsed
'
);
}
// prevent default action for disabled buttons
...
...
@@ -108,7 +110,8 @@ document.addEventListener('DOMContentLoaded', () => {
addSelectOnFocusBehaviour
(
'
.js-select-on-focus
'
);
$
(
'
.remove-row
'
).
on
(
'
ajax:success
'
,
function
removeRowAjaxSuccessCallback
()
{
$
(
this
).
tooltip
(
'
destroy
'
)
$
(
this
)
.
tooltip
(
'
destroy
'
)
.
closest
(
'
li
'
)
.
fadeOut
();
});
...
...
@@ -118,7 +121,9 @@ document.addEventListener('DOMContentLoaded', () => {
});
$
(
'
.js-remove-tr
'
).
on
(
'
ajax:success
'
,
function
removeTRAjaxSuccessCallback
()
{
$
(
this
).
closest
(
'
tr
'
).
fadeOut
();
$
(
this
)
.
closest
(
'
tr
'
)
.
fadeOut
();
});
// Initialize select2 selects
...
...
@@ -155,7 +160,9 @@ document.addEventListener('DOMContentLoaded', () => {
// Form submitter
$
(
'
.trigger-submit
'
).
on
(
'
change
'
,
function
triggerSubmitCallback
()
{
$
(
this
).
parents
(
'
form
'
).
submit
();
$
(
this
)
.
parents
(
'
form
'
)
.
submit
();
});
localTimeAgo
(
$
(
'
abbr.timeago, .js-timeago
'
),
true
);
...
...
@@ -204,9 +211,15 @@ document.addEventListener('DOMContentLoaded', () => {
$this
.
toggleClass
(
'
active
'
);
if
(
$this
.
hasClass
(
'
active
'
))
{
notesHolders
.
show
().
find
(
'
.hide, .content
'
).
show
();
notesHolders
.
show
()
.
find
(
'
.hide, .content
'
)
.
show
();
}
else
{
notesHolders
.
hide
().
find
(
'
.content
'
).
hide
();
notesHolders
.
hide
()
.
find
(
'
.content
'
)
.
hide
();
}
$
(
document
).
trigger
(
'
toggle.comments
'
);
...
...
@@ -247,9 +260,11 @@ document.addEventListener('DOMContentLoaded', () => {
const
flashContainer
=
document
.
querySelector
(
'
.flash-container
'
);
if
(
flashContainer
&&
flashContainer
.
children
.
length
)
{
flashContainer
.
querySelectorAll
(
'
.flash-alert, .flash-notice, .flash-success
'
).
forEach
((
flashEl
)
=>
{
removeFlashClickListener
(
flashEl
);
});
flashContainer
.
querySelectorAll
(
'
.flash-alert, .flash-notice, .flash-success
'
)
.
forEach
(
flashEl
=>
{
removeFlashClickListener
(
flashEl
);
});
}
initDispatcher
();
...
...
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