Merge pull request #24207 from shadinaif/shadinaif/instructor_dashboard_js

Resolve errors in browser console caused by Instructor Dashboard
This commit is contained in:
Nimisha Asthagiri
2020-09-23 07:04:57 -04:00
committed by GitHub

View File

@@ -181,9 +181,6 @@ such that the value can be defined later than this assignment (file load order).
}, {
constructor: window.InstructorDashboard.sections.Email,
$element: idashContent.find('.' + CSS_IDASH_SECTION + '#send_email')
}, {
constructor: window.InstructorDashboard.sections.InstructorAnalytics,
$element: idashContent.find('.' + CSS_IDASH_SECTION + '#instructor_analytics')
}, {
constructor: window.InstructorDashboard.sections.Metrics,
$element: idashContent.find('.' + CSS_IDASH_SECTION + '#metrics')
@@ -220,7 +217,11 @@ such that the value can be defined later than this assignment (file load order).
constructor = _arg.constructor;
$element = _arg.$element;
return plantTimeout(0, sectionsHaveLoaded.waitFor(function() {
return new constructor($element);
if ($element[0]) {
return new constructor($element);
} else {
return null;
}
}));
});
};