Skip to content

Commit

Permalink
Merge pull request #52 from harvard-canvas-branding/task/thornton/tlt…
Browse files Browse the repository at this point in the history
…-2584/disable_copy_course_button

Disabled copy course button
  • Loading branch information
sapnamysore authored Jul 6, 2018
2 parents 9bfa3dd + 93059aa commit a18ce90
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions 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 @@ -48,11 +52,18 @@ function sortRoleDropdown(){
roleSelect.html(optList);
}

function disableCopyCourseButton() {
$('a.copy_course_link').addClass('disabled');
}

function initHUGlobal() {
var reCourseSettingsPage = /courses\/.+?\/settings/;
var windowUrl = window.location.pathname;
var onCourseSettingsPage = (windowUrl.search(reCourseSettingsPage) != -1);
if (onCourseSettingsPage) {
if (isCopyButtonPresent()){
disableCopyCourseButton();
}
if (isConcludeButtonPresent()) {
disableCourseConcludeButton();
} else {
Expand Down

0 comments on commit a18ce90

Please sign in to comment.