Skip to content

Commit

Permalink
Added a check for the presence of the copy button.
Browse files Browse the repository at this point in the history
  • Loading branch information
sapnamysore committed Jul 6, 2018
1 parent b223919 commit 93059aa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/course_settings_disable_course_conclude.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ function isConcludeButtonPresent(){
return $("a[class~='Button'][href$='event=conclude']").length > 0;
}

function isCopyButtonPresent(){
return $("a[class~='copy_course_link']").length > 0;
}

function sortRoleDropdown(){
var roleSelect = $('select').first();
var optList = roleSelect.find('option');
Expand All @@ -57,7 +61,9 @@ function initHUGlobal() {
var windowUrl = window.location.pathname;
var onCourseSettingsPage = (windowUrl.search(reCourseSettingsPage) != -1);
if (onCourseSettingsPage) {
disableCopyCourseButton();
if (isCopyButtonPresent()){
disableCopyCourseButton();
}
if (isConcludeButtonPresent()) {
disableCourseConcludeButton();
} else {
Expand Down

0 comments on commit 93059aa

Please sign in to comment.