Fix course enroll button on program details.

If there is no dropdown for a course but there is another course in program
which have a dropdown, $('.run-select').val() returns that run's value. Fixed
by using $el.

PROD-1217
This commit is contained in:
Waheed Ahmed
2020-01-27 15:03:47 +05:00
parent 4799f40d88
commit 2cf888135b

View File

@@ -48,7 +48,7 @@ class CourseEnrollView extends Backbone.View {
handleEnroll() {
// Enrollment click event handled here
if (this.model.get('is_mobile_only') !== true) {
const courseRunKey = $('.run-select').val() || this.model.get('course_run_key');
const courseRunKey = this.$el.find('.run-select').val() || this.model.get('course_run_key');
this.model.updateCourseRun(courseRunKey);
if (this.model.get('is_enrolled')) {
// Create the enrollment.