Index: lams_central/web/includes/javascript/groupDisplay.js =================================================================== diff -u -r3e10e8eaf62fd5d62ddf1082b2775fcaf0ec8f9c -r13912543234d7fdec6cb7dec5ab9ba803c07ff19 --- lams_central/web/includes/javascript/groupDisplay.js (.../groupDisplay.js) (revision 3e10e8eaf62fd5d62ddf1082b2775fcaf0ec8f9c) +++ lams_central/web/includes/javascript/groupDisplay.js (.../groupDisplay.js) (revision 13912543234d7fdec6cb7dec5ab9ba803c07ff19) @@ -35,6 +35,7 @@ saveCollapsed(orgId, "true"); } } + makeAllUnsortable(); }); } @@ -78,6 +79,35 @@ }); } + function makeOrgSortable(orgId) { + var org = jQuery("div.course-bg#"+orgId); + if (jQuery("div.j-lessons", org).size() > 0) { + var jLessons = jQuery("div.j-lessons#"+orgId+"-lessons"); + makeSortable(jLessons, "j-single-lesson"); + jQuery("div.j-subgroup-lessons", org).each(function() { + makeSortable(jQuery(this), "j-single-subgroup-lesson"); + }); + jQuery("div.mycourses-right-buttons", jLessons).html(getSortingEnabledText()); + } + } + + function makeAllUnsortable() { + jQuery("div.course-bg").each(function() { + var orgId = this.id; + if (jQuery("div.j-lessons", this).size() > 0) { + var jLessons = jQuery("div.j-lessons#"+orgId+"-lessons") + var link = jQuery("div.mycourses-right-buttons", jLessons); + if (link.html().indexOf(getSortingEnabledText()) >= 0) { + jLessons.SortableDestroy(); + link.html(""+getEnableSortingText()+""); + jQuery("div.j-subgroup-lessons", this).each(function() { + jQuery(this).SortableDestroy(); + }); + } + } + }); + } + function makeSortable(element, acceptClass) { jQuery(element).Sortable({ accept: acceptClass,