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
3492c375
Commit
3492c375
authored
Jun 18, 2020
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some comments with action items
parent
4ff5ed14
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+20
-2
No files found.
app/assets/javascripts/main.js
View file @
3492c375
...
...
@@ -176,6 +176,15 @@ document.addEventListener('DOMContentLoaded', () => {
}
});
/**
* TODO: Apparently we are collapsing the right sidebar on certain screensizes per default
* except on issue board pages. Why can't we do it with CSS?
*
* Proposal: Expose a global sidebar API, which we could import wherever we are manipulating
* the visibility of the sidebar.
*
* Quick fix: Get rid of jQuery for this implementation
*/
const
isBoardsPage
=
/
(
projects|groups
)
:boards:show/
.
test
(
document
.
body
.
dataset
.
page
);
if
(
!
isBoardsPage
&&
(
bootstrapBreakpoint
===
'
sm
'
||
bootstrapBreakpoint
===
'
xs
'
))
{
const
$rightSidebar
=
$
(
'
aside.right-sidebar
'
);
...
...
@@ -202,7 +211,12 @@ document.addEventListener('DOMContentLoaded', () => {
localTimeAgo
(
$
(
'
abbr.timeago, .js-timeago
'
),
true
);
// Disable form buttons while a form is submitting
/**
* This disables form buttons while a form is submitting
* We do not difinitively know all of the places where this is used
*
* TODO: Defer execution, migrate to behaviors, and add sentry logging
*/
$body
.
on
(
'
ajax:complete, ajax:beforeSend, submit
'
,
'
form
'
,
function
ajaxCompleteCallback
(
e
)
{
const
$buttons
=
$
(
'
[type="submit"], .js-disable-on-submit
'
,
this
).
not
(
'
.js-no-auto-disable
'
);
switch
(
e
.
type
)
{
...
...
@@ -229,7 +243,11 @@ document.addEventListener('DOMContentLoaded', () => {
$
(
'
.header-content
'
).
toggleClass
(
'
menu-expanded
'
);
});
// Commit show suppressed diff
/**
* Show suppressed commit diff
*
* TODO: Move to commit diff pages
*/
$document
.
on
(
'
click
'
,
'
.diff-content .js-show-suppressed-diff
'
,
function
showDiffCallback
()
{
const
$container
=
$
(
this
).
parent
();
$container
.
next
(
'
table
'
).
show
();
...
...
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