Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
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
course-discovery
Commits
0498046b
Commit
0498046b
authored
Sep 20, 2017
by
attiyaishaque
Committed by
Attiya Ishaque
Sep 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Selected instructor display and deletion on editing course run.
parent
e6647c84
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
15 deletions
+10
-15
course_discovery/static/js/publisher/instructors.js
+10
-15
No files found.
course_discovery/static/js/publisher/instructors.js
View file @
0498046b
...
...
@@ -9,6 +9,16 @@ $(document).ready(function(){
renderSelectedInstructor
(
id
,
name
,
image_source
,
uuid
);
});
$
(
"#id_staff"
).
on
(
"select2:select"
,
function
(
e
)
{
var
$instructorSelector
=
e
.
params
.
data
,
id
=
$instructorSelector
.
id
,
selectedInstructorData
=
$
.
parseHTML
(
$instructorSelector
.
text
)[
0
],
image_source
=
$
(
selectedInstructorData
).
find
(
'img'
).
attr
(
'src'
),
name
=
$
(
selectedInstructorData
).
find
(
'b'
).
text
();
renderSelectedInstructor
(
id
,
name
,
image_source
);
});
$
(
'#add-new-instructor'
).
click
(
function
(
e
){
clearModalError
();
var
btnInstructor
=
$
(
'#add-instructor-btn'
);
...
...
@@ -112,21 +122,6 @@ function loadSelectedImage(input) {
}
}
$
(
document
).
on
(
'change'
,
'#id_staff'
,
function
(
e
)
{
var
$instructorSelector
=
$
(
'.instructor-select'
),
$instructor
=
$instructorSelector
.
find
(
'.select2-selection__choice'
),
id
=
$instructor
.
find
(
'.instructor-option'
).
last
().
prop
(
"id"
),
image_source
,
name
;
$instructorSelector
.
find
(
'.select2-selection__clear'
).
remove
();
image_source
=
$instructor
.
find
(
'img'
).
last
().
attr
(
'src'
);
name
=
$instructor
.
find
(
'b'
).
last
().
text
();
renderSelectedInstructor
(
id
,
name
,
image_source
);
$instructor
.
remove
();
});
$
(
document
).
on
(
'click'
,
'.selected-instructor a.delete'
,
function
(
e
)
{
e
.
preventDefault
();
var
id
=
this
.
id
,
...
...
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