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
1dc3d703
Commit
1dc3d703
authored
Jun 21, 2017
by
Luke "Jared" Bennett
Committed by
Phil Hughes
Jun 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Protected branch dropdowns cut-off in Repository Settings page"
parent
1578ee93
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
4 deletions
+25
-4
app/assets/javascripts/settings_panels.js
app/assets/javascripts/settings_panels.js
+21
-4
app/assets/stylesheets/pages/settings.scss
app/assets/stylesheets/pages/settings.scss
+4
-0
No files found.
app/assets/javascripts/settings_panels.js
View file @
1dc3d703
function
expandSectionParent
(
$section
,
$content
)
{
$section
.
addClass
(
'
expanded
'
);
$content
.
off
(
'
animationend.expandSectionParent
'
);
}
function
expandSection
(
$section
)
{
$section
.
find
(
'
.js-settings-toggle
'
).
text
(
'
Close
'
);
$section
.
find
(
'
.settings-content
'
).
addClass
(
'
expanded
'
).
off
(
'
scroll
'
).
scrollTop
(
0
);
const
$content
=
$section
.
find
(
'
.settings-content
'
);
$content
.
addClass
(
'
expanded
'
).
off
(
'
scroll.expandSection
'
).
scrollTop
(
0
);
if
(
$content
.
hasClass
(
'
no-animate
'
))
{
expandSectionParent
(
$section
,
$content
);
}
else
{
$content
.
on
(
'
animationend.expandSectionParent
'
,
()
=>
expandSectionParent
(
$section
,
$content
));
}
}
function
closeSection
(
$section
)
{
$section
.
find
(
'
.js-settings-toggle
'
).
text
(
'
Expand
'
);
$section
.
find
(
'
.settings-content
'
).
removeClass
(
'
expanded
'
).
on
(
'
scroll
'
,
()
=>
expandSection
(
$section
));
const
$content
=
$section
.
find
(
'
.settings-content
'
);
$content
.
removeClass
(
'
expanded
'
).
on
(
'
scroll.expandSection
'
,
()
=>
expandSection
(
$section
));
$section
.
removeClass
(
'
expanded
'
);
}
function
toggleSection
(
$section
)
{
...
...
@@ -21,7 +38,7 @@ function toggleSection($section) {
export
default
function
initSettingsPanels
()
{
$
(
'
.settings
'
).
each
((
i
,
elm
)
=>
{
const
$section
=
$
(
elm
);
$section
.
on
(
'
click
'
,
'
.js-settings-toggle
'
,
()
=>
toggleSection
(
$section
));
$section
.
find
(
'
.settings-content:not(.expanded)
'
).
on
(
'
scroll
'
,
()
=>
expandSection
(
$section
));
$section
.
on
(
'
click
.toggleSection
'
,
'
.js-settings-toggle
'
,
()
=>
toggleSection
(
$section
));
$section
.
find
(
'
.settings-content:not(.expanded)
'
).
on
(
'
scroll
.expandSection
'
,
()
=>
expandSection
(
$section
));
});
}
app/assets/stylesheets/pages/settings.scss
View file @
1dc3d703
...
...
@@ -29,6 +29,10 @@
&
:first-of-type
{
margin-top
:
10px
;
}
&
.expanded
{
overflow
:
visible
;
}
}
.settings-header
{
...
...
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