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
6b8944ad
Commit
6b8944ad
authored
Jan 07, 2013
by
Brian Talbot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
studio - section expanding/collapsing UI - wip
parent
ce4994dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
15 deletions
+26
-15
cms/static/js/base.js
+13
-4
cms/static/sass/_courseware.scss
+13
-11
No files found.
cms/static/js/base.js
View file @
6b8944ad
...
@@ -41,7 +41,12 @@ $(document).ready(function() {
...
@@ -41,7 +41,12 @@ $(document).ready(function() {
$
(
'.unit .item-actions .delete-button'
).
bind
(
'click'
,
deleteUnit
);
$
(
'.unit .item-actions .delete-button'
).
bind
(
'click'
,
deleteUnit
);
$
(
'.new-unit-item'
).
bind
(
'click'
,
createNewUnit
);
$
(
'.new-unit-item'
).
bind
(
'click'
,
createNewUnit
);
$
(
'.collapse-all-button'
).
bind
(
'click'
,
collapseAll
);
// toggling overview section details
$
(
function
(){
if
(
$
(
'.courseware-section'
).
length
>
0
)
{
$
(
'.toggle-button-sections'
).
addClass
(
'is-shown'
);
}
});
$
(
'.toggle-button-sections'
).
bind
(
'click'
,
toggleSections
);
$
(
'.toggle-button-sections'
).
bind
(
'click'
,
toggleSections
);
// autosave when a field is updated on the subsection page
// autosave when a field is updated on the subsection page
...
@@ -135,13 +140,17 @@ function toggleSections(e) {
...
@@ -135,13 +140,17 @@ function toggleSections(e) {
e
.
preventDefault
();
e
.
preventDefault
();
$section
=
$
(
'.courseware-section'
);
$section
=
$
(
'.courseware-section'
);
sectionCount
=
$section
.
length
;
$button
=
$
(
this
);
$button
=
$
(
this
);
$labelCollapsed
=
$
(
'<i class="ss-icon ss-symbolicons-block">up</i> <span class="label">Collapse All Sections</span>'
);
$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>'
);
$labelExpanded
=
$
(
'<i class="ss-icon ss-symbolicons-block">down</i> <span class="label">Expand All Sections</span>'
);
$section
.
toggleClass
(
'collapsed'
);
if
(
sectionCount
>
0
)
{
var
buttonLabel
=
$section
.
hasClass
(
'collapsed'
)
?
$labelExpanded
:
$labelCollapsed
;
$section
.
toggleClass
(
'collapsed'
);
$button
.
toggleClass
(
'is-activated'
).
html
(
buttonLabel
);
$section
.
find
(
'.expand-collapse-icon'
).
toggleClass
(
'collapse expand'
);
var
buttonLabel
=
$section
.
hasClass
(
'collapsed'
)
?
$labelExpanded
:
$labelCollapsed
;
$button
.
toggleClass
(
'is-activated'
).
html
(
buttonLabel
);
}
}
}
function
editSectionPublishDate
(
e
)
{
function
editSectionPublishDate
(
e
)
{
...
...
cms/static/sass/_courseware.scss
View file @
6b8944ad
...
@@ -422,6 +422,14 @@ input.courseware-unit-search-input {
...
@@ -422,6 +422,14 @@ input.courseware-unit-search-input {
float
:
left
;
float
:
left
;
margin
:
29px
6px
16px
16px
;
margin
:
29px
6px
16px
16px
;
@include
transition
(
none
);
@include
transition
(
none
);
&
.expand
{
background-position
:
0
0
;
}
&
.collapsed
{
}
}
}
.drag-handle
{
.drag-handle
{
...
@@ -501,18 +509,8 @@ input.courseware-unit-search-input {
...
@@ -501,18 +509,8 @@ input.courseware-unit-search-input {
}
}
}
}
.collapse-all-button
{
float
:
right
;
margin-top
:
10px
;
font-size
:
13px
;
color
:
$darkGrey
;
.collapse-all-icon
{
margin-right
:
6px
;
}
}
.toggle-button-sections
{
.toggle-button-sections
{
display
:
none
;
position
:
relative
;
position
:
relative
;
float
:
right
;
float
:
right
;
margin-top
:
10px
;
margin-top
:
10px
;
...
@@ -520,6 +518,10 @@ input.courseware-unit-search-input {
...
@@ -520,6 +518,10 @@ input.courseware-unit-search-input {
font-size
:
13px
;
font-size
:
13px
;
color
:
$darkGrey
;
color
:
$darkGrey
;
&
.is-shown
{
display
:
block
;
}
.ss-icon
{
.ss-icon
{
@include
border-radius
(
20px
);
@include
border-radius
(
20px
);
position
:
relative
;
position
:
relative
;
...
...
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