Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
ce4994dd
Commit
ce4994dd
authored
Jan 04, 2013
by
Brian Talbot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
studio - revised course overview section collapse button to toggle collapsing/expanding
parent
edd9b2bc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
1 deletions
+38
-1
cms/static/js/base.js
+14
-0
cms/static/sass/_courseware.scss
+23
-0
cms/templates/overview.html
+1
-1
No files found.
cms/static/js/base.js
View file @
ce4994dd
...
...
@@ -42,6 +42,7 @@ $(document).ready(function() {
$
(
'.new-unit-item'
).
bind
(
'click'
,
createNewUnit
);
$
(
'.collapse-all-button'
).
bind
(
'click'
,
collapseAll
);
$
(
'.toggle-button-sections'
).
bind
(
'click'
,
toggleSections
);
// autosave when a field is updated on the subsection page
$body
.
on
(
'keyup'
,
'.subsection-display-name-input, .unit-subtitle, .policy-list-value'
,
checkForNewValue
);
...
...
@@ -130,6 +131,19 @@ function collapseAll(e) {
$
(
'.expand-collapse-icon'
).
removeClass
(
'collapse'
).
addClass
(
'expand'
);
}
function
toggleSections
(
e
)
{
e
.
preventDefault
();
$section
=
$
(
'.courseware-section'
);
$button
=
$
(
this
);
$labelCollapsed
=
$
(
'<i class="ss-icon ss-symbolicons-block">up</i> <span class="label">Collapse All Sections</span>'
);
$labelExpanded
=
$
(
'<i class="ss-icon ss-symbolicons-block">down</i> <span class="label">Expand All Sections</span>'
);
$section
.
toggleClass
(
'collapsed'
);
var
buttonLabel
=
$section
.
hasClass
(
'collapsed'
)
?
$labelExpanded
:
$labelCollapsed
;
$button
.
toggleClass
(
'is-activated'
).
html
(
buttonLabel
);
}
function
editSectionPublishDate
(
e
)
{
e
.
preventDefault
();
$modal
=
$
(
'.edit-subsection-publish-settings'
).
show
();
...
...
cms/static/sass/_courseware.scss
View file @
ce4994dd
...
...
@@ -512,6 +512,29 @@ input.courseware-unit-search-input {
}
}
.toggle-button-sections
{
position
:
relative
;
float
:
right
;
margin-top
:
10px
;
font-size
:
13px
;
color
:
$darkGrey
;
.ss-icon
{
@include
border-radius
(
20px
);
position
:
relative
;
top
:
-1px
;
display
:
inline-block
;
margin-right
:
2px
;
line-height
:
5px
;
font-size
:
11px
;
}
.label
{
display
:
inline-block
;
}
}
.new-section-name
,
.new-subsection-name-input
{
width
:
515px
;
...
...
cms/templates/overview.html
View file @
ce4994dd
...
...
@@ -122,7 +122,7 @@
<div
class=
"inner-wrapper"
>
<div
class=
"page-actions"
>
<a
href=
"#"
class=
"new-button new-courseware-section-button"
><span
class=
"plus-icon white"
></span>
New Section
</a>
<a
href=
"#"
class=
"
collapse-all-button"
><span
class=
"collapse-all-icon"
></span>
Collapse All
</a>
<a
href=
"#"
class=
"
toggle-button toggle-button-sections"
><i
class=
"ss-icon ss-symbolicons-block"
>
up
</i>
<span
class=
"label"
>
Collapse All Sections
</span>
</a>
</div>
<article
class=
"courseware-overview"
data-course-id=
"${context_course.location.url()}"
>
% for section in 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