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
da4c0be0
Commit
da4c0be0
authored
7 years ago
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove needlessly complicated, duplicate css class for expanded settings panels
parent
979e3a59
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
27 deletions
+27
-27
app/assets/javascripts/settings_panels.js
app/assets/javascripts/settings_panels.js
+23
-22
app/assets/stylesheets/pages/settings.scss
app/assets/stylesheets/pages/settings.scss
+4
-5
No files found.
app/assets/javascripts/settings_panels.js
View file @
da4c0be0
function
expandSectionParent
(
$section
,
$content
)
{
$section
.
addClass
(
'
expanded
'
);
$content
.
off
(
'
animationend.expandSectionParent
'
);
}
function
expandSection
(
$section
)
{
$section
.
find
(
'
.js-settings-toggle
'
).
text
(
'
Collapse
'
);
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
));
$section
.
find
(
'
.settings-content
'
).
off
(
'
scroll.expandSection
'
).
scrollTop
(
0
);
$section
.
addClass
(
'
expanded
'
);
if
(
!
$section
.
hasClass
(
'
no-animate
'
))
{
$section
.
addClass
(
'
animating
'
)
.
one
(
'
animationend.animateSection
'
,
()
=>
$section
.
removeClass
(
'
animating
'
));
}
}
function
closeSection
(
$section
)
{
$section
.
find
(
'
.js-settings-toggle
'
).
text
(
'
Expand
'
);
const
$content
=
$section
.
find
(
'
.settings-content
'
);
$content
.
removeClass
(
'
expanded
'
).
on
(
'
scroll.expandSection
'
,
()
=>
expandSection
(
$section
));
$section
.
find
(
'
.settings-content
'
).
on
(
'
scroll.expandSection
'
,
()
=>
expandSection
(
$section
));
$section
.
removeClass
(
'
expanded
'
);
if
(
!
$section
.
hasClass
(
'
no-animate
'
))
{
$section
.
addClass
(
'
animating
'
)
.
one
(
'
animationend.animateSection
'
,
()
=>
$section
.
removeClass
(
'
animating
'
));
}
}
function
toggleSection
(
$section
)
{
const
$content
=
$section
.
find
(
'
.settings-content
'
);
$content
.
removeClass
(
'
no-animate
'
);
if
(
$content
.
hasClass
(
'
expanded
'
))
{
$section
.
removeClass
(
'
no-animate
'
);
if
(
$section
.
hasClass
(
'
expanded
'
))
{
closeSection
(
$section
);
}
else
{
expandSection
(
$section
);
...
...
@@ -39,10 +31,19 @@ export default function initSettingsPanels() {
$
(
'
.settings
'
).
each
((
i
,
elm
)
=>
{
const
$section
=
$
(
elm
);
$section
.
on
(
'
click.toggleSection
'
,
'
.js-settings-toggle
'
,
()
=>
toggleSection
(
$section
));
$section
.
find
(
'
.settings-content:not(.expanded)
'
).
on
(
'
scroll.expandSection
'
,
()
=>
expandSection
(
$section
));
if
(
!
$section
.
hasClass
(
'
expanded
'
))
{
$section
.
find
(
'
.settings-content
'
).
on
(
'
scroll.expandSection
'
,
()
=>
{
$section
.
removeClass
(
'
no-animate
'
);
expandSection
(
$section
);
});
}
});
if
(
location
.
hash
)
{
expandSection
(
$
(
location
.
hash
));
const
$target
=
$
(
location
.
hash
);
if
(
$target
.
length
&&
$target
.
hasClass
(
'
.settings
'
))
{
expandSection
(
$target
);
}
}
}
This diff is collapsed.
Click to expand it.
app/assets/stylesheets/pages/settings.scss
View file @
da4c0be0
...
...
@@ -23,15 +23,14 @@
}
.settings
{
overflow
:
hidden
;
border-bottom
:
1px
solid
$gray-darker
;
&
:first-of-type
{
margin-top
:
10px
;
}
&
.
expanded
{
overflow
:
visible
;
&
.
animating
{
overflow
:
hidden
;
}
}
...
...
@@ -57,13 +56,13 @@
padding-right
:
110px
;
animation
:
collapseMaxHeight
300ms
ease-out
;
&
.expanded
{
.settings.expanded
&
{
max-height
:
none
;
overflow-y
:
visible
;
animation
:
expandMaxHeight
300ms
ease-in
;
}
&
.no-animate
{
.settings.no-animate
&
{
animation
:
none
;
}
...
...
This diff is collapsed.
Click to expand it.
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