Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
schedules
Commits
8ecb3aa9
Commit
8ecb3aa9
authored
Nov 16, 2018
by
Zac Wood
Browse files
chevron changes direction on expand
parent
e84ff52f
Pipeline
#3372
passed with stage
in 2 minutes and 12 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
schedules/app/assets/javascripts/search.js
View file @
8ecb3aa9
// Place all the behaviors and hooks related to the matching controller here.
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
// All this logic will automatically be available in application.js.
const
sectionWithCrn
=
crn
=>
document
.
getElementById
(
'
search-list
'
).
querySelector
(
`[data-crn="
${
crn
}
"]`
);
/**
/**
* Either adds or removes a section from the cart depending on
* Either adds or removes a section from the cart depending on
* if it is currently in the cart.
* if it is currently in the cart.
...
@@ -24,11 +22,17 @@ const addOrRemoveFromCart = async (event, sectionNode) => {
...
@@ -24,11 +22,17 @@ const addOrRemoveFromCart = async (event, sectionNode) => {
*/
*/
const
toggleSections
=
course
=>
{
const
toggleSections
=
course
=>
{
const
sections
=
course
.
querySelector
(
'
.sections
'
);
const
sections
=
course
.
querySelector
(
'
.sections
'
);
const
chev
=
$
(
course
.
querySelector
(
'
#course-chevron
'
));
const
label
=
course
.
querySelector
(
'
#chevron-label
'
);
if
(
sections
.
style
.
display
===
'
flex
'
)
{
if
(
sections
.
style
.
display
===
'
flex
'
)
{
sections
.
style
.
display
=
'
none
'
;
sections
.
style
.
display
=
'
none
'
;
chev
.
addClass
(
'
fa-chevron-down
'
).
removeClass
(
'
fa-chevron-up
'
);
label
.
innerText
=
'
Expand
'
;
}
else
{
}
else
{
sections
.
style
.
display
=
'
flex
'
;
sections
.
style
.
display
=
'
flex
'
;
chev
.
addClass
(
'
fa-chevron-up
'
).
removeClass
(
'
fa-chevron-down
'
);
label
.
innerText
=
'
Minimize
'
;
}
}
};
};
...
...
schedules/app/assets/stylesheets/search.scss
View file @
8ecb3aa9
...
@@ -8,10 +8,11 @@
...
@@ -8,10 +8,11 @@
}
}
.section-item.selected
{
.section-item.selected
{
transition
:
0
.15s
;
background-color
:
lightgreen
;
background-color
:
lightgreen
;
}
}
.section-item.selected
:hover
{
.section-item.selected
:hover
{
transition
:
0
.15s
;
transition
:
0
.15s
;
background-color
:
r
ed
;
background-color
:
r
gba
(
255
,
0
,
0
,
0
.6
)
;
}
}
schedules/app/views/shared/_course.html.erb
View file @
8ecb3aa9
...
@@ -24,8 +24,7 @@
...
@@ -24,8 +24,7 @@
<div
class=
"icon"
>
<div
class=
"icon"
>
<i
class=
"fa fa-bars"
></i>
<i
class=
"fa fa-bars"
></i>
</div>
</div>
<!-- TODO: FIX THIS -->
<%=
course
.
course_sections
.
count
%>
sections
<%#= "#{course.section_count}" %>
<%=
course
.
course_sections
.
count
%>
sections
</div>
</div>
</div>
</div>
<p
class=
"description"
>
<%=
course
.
description
%>
</p>
<p
class=
"description"
>
<%=
course
.
description
%>
</p>
...
@@ -37,8 +36,8 @@
...
@@ -37,8 +36,8 @@
<%
end
%>
<%
end
%>
<div
class=
"d-block"
style=
"text-align: center"
>
<div
class=
"d-block"
style=
"text-align: center"
>
<p
style=
"margin-bottom:-4px; font-size: 10px;"
>
Expand
</p>
<p
id=
"chevron-label"
style=
"margin-bottom:-4px; font-size: 10px;"
>
Expand
</p>
<i
class=
"fas fa-chevron-down"
></i>
<i
id=
"course-chevron"
class=
"fas fa-chevron-down"
></i>
</div>
</div>
<!-- List of Course Sections -->
<!-- List of Course Sections -->
...
...
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