Updating javascript to enable display of correct content type name in internal class message "only display x within my institution" on content type change. NIHVIVO-3026

This commit is contained in:
hjkhjk54 2011-07-21 19:17:24 +00:00
parent 154a3b80ad
commit e1eca52416

View file

@ -19,12 +19,13 @@ var menuManagementEdit = {
this.selectedGroupForPage = $('#selectedContentTypeValue');
// this.selectClassesMessage = $('#selectClassesMessage');
this.allClassesSelectedCheckbox = $('#allSelected');
this.displayInternalMessage = $('#internal-class label em');
},
bindEventListeners: function() {
// Listeners for vClass switching
this.changeContentType.click(function() {
menuManagementEdit.showClassGroups();
return false;
});
this.selectClassGroupDropdown.change(function() {
@ -54,6 +55,10 @@ var menuManagementEdit = {
}
});
},
updateInternalClassMessage:function(classGroupName) { //User has changed content type
//Set content type within internal class message
this.displayInternalMessage.filter(":first").html(classGroupName);
},
showClassGroups: function() { //User has clicked change content type
//Show the section with the class group dropdown
this.selectContentType.removeClass("hidden");
@ -148,7 +153,9 @@ var menuManagementEdit = {
menuManagementEdit.hideClassGroups();
menuManagementEdit.selectedGroupForPage.html(results.classGroupName);
//retrieve classes for class group and display with all selected
//update content type in message to "display x within my institution"
menuManagementEdit.updateInternalClassMessage(results.classGroupName);
//retrieve classes for class group and display with all selected
var selectedClassesList = menuManagementEdit.classesForClassGroup.children('ul#selectedClasses');
selectedClassesList.empty();