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
9dc6cdbd
Commit
9dc6cdbd
authored
Oct 24, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove vestigial save-subsection button
parent
2dd77656
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
12 deletions
+7
-12
cms/static/js/base.js
+6
-9
cms/templates/edit_subsection.html
+1
-3
No files found.
cms/static/js/base.js
View file @
9dc6cdbd
...
...
@@ -33,7 +33,6 @@ $(document).ready(function() {
$
(
'.unit .item-actions .delete-button'
).
bind
(
'click'
,
deleteUnit
);
$
(
'.new-unit-item'
).
bind
(
'click'
,
createNewUnit
);
$
(
'.save-subsection'
).
bind
(
'click'
,
saveSubsection
);
// autosave when a field is updated on the subsection page
$body
.
on
(
'keyup'
,
'.subsection-display-name-input, .unit-subtitle, .policy-list-value'
,
checkForNewValue
);
...
...
@@ -169,7 +168,7 @@ function savePolicyMetadata(e) {
e
.
preventDefault
();
var
$policyElement
=
$
(
this
).
parents
(
'.policy-list-element'
);
$
(
'.save-subsection'
).
click
();
saveSubsection
()
$policyElement
.
removeClass
(
'new-policy-list-element'
);
$policyElement
.
find
(
'.policy-list-name'
).
attr
(
'disabled'
,
'disabled'
);
$policyElement
.
removeClass
(
'editing'
);
...
...
@@ -202,7 +201,7 @@ function removePolicyMetadata(e) {
}
else
{
_parent_el
.
appendTo
(
"#policy-to-delete"
);
}
$
(
'.save-subsection'
).
click
();
saveSubsection
()
}
...
...
@@ -299,7 +298,7 @@ function checkForNewValue(e) {
this
.
saveTimer
=
setTimeout
(
function
()
{
$changedInput
=
$
(
e
.
target
);
$
(
'.save-subsection'
).
click
();
saveSubsection
()
this
.
saveTimer
=
null
;
},
500
);
}
...
...
@@ -312,14 +311,12 @@ function autosaveInput(e) {
this
.
saveTimer
=
setTimeout
(
function
()
{
$changedInput
=
$
(
e
.
target
);
$
(
'.save-subsection'
).
click
();
saveSubsection
()
this
.
saveTimer
=
null
;
},
500
);
}
function
saveSubsection
(
e
)
{
e
.
preventDefault
();
function
saveSubsection
()
{
if
(
$changedInput
&&
!
$changedInput
.
hasClass
(
'no-spinner'
))
{
$spinner
.
css
({
'position'
:
'absolute'
,
...
...
@@ -331,7 +328,7 @@ function saveSubsection(e) {
$spinner
.
show
();
}
var
id
=
$
(
this
).
data
(
'id'
);
var
id
=
$
(
'.subsection-body'
).
data
(
'id'
);
// pull all 'normalized' metadata editable fields on page
var
metadata_fields
=
$
(
'input[data-metadata-name]'
);
...
...
cms/templates/edit_subsection.html
View file @
9dc6cdbd
...
...
@@ -18,7 +18,7 @@
<div
class=
"main-wrapper"
>
<div
class=
"inner-wrapper"
>
<div
class=
"main-column"
>
<article
class=
"subsection-body window"
>
<article
class=
"subsection-body window"
data-id=
"${subsection.location}"
>
<div
class=
"subsection-name-input"
>
<label>
Display Name:
</label>
<input
type=
"text"
value=
"${subsection.metadata['display_name']}"
class=
"subsection-display-name-input"
data-metadata-name=
"display_name"
/>
...
...
@@ -37,7 +37,6 @@
% for policy_name in policy_metadata.keys():
<li
class=
"policy-list-element"
>
<input
type=
"text"
class=
"policy-list-name"
name=
"${policy_name}"
value=
"${policy_name}"
disabled
size=
"15"
/>
:
<input
type=
"text"
class=
"policy-list-value"
name=
"${policy_metadata[policy_name]}"
value=
"${policy_metadata[policy_name]}"
size=
"40"
/>
<a
href=
"#"
class=
"save-button"
>
Save
</a>
<a
href=
"#"
class=
"cancel-button"
>
Cancel
</a>
<a
href=
"#"
class=
"delete-icon remove-policy-data"
></a>
</li>
...
...
@@ -101,7 +100,6 @@
</div>
</div>
<div
class=
"row unit-actions"
>
<a
href=
"#"
class=
"save-button save-subsection"
data-id=
"${subsection.location}"
>
Save
</a>
<a
href=
"${preview_link}"
target=
"_blank"
class=
"preview-button"
>
Preview Drafts
</a>
%if can_view_live:
<a
href=
"${lms_link}"
target=
"_blank"
class=
"preview-button"
>
View Live
</a>
...
...
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