updates to make sure default template is not selected in javascript if editing (in which case template should select either default or custom)

This commit is contained in:
hjkhjk54 2012-06-19 21:12:49 +00:00
parent ab17e812a0
commit 414df19928

View file

@ -18,10 +18,22 @@ var pageManagementUtils = {
this.bindEventListeners(); this.bindEventListeners();
this.initDisplay(); this.initDisplay();
//if edit, then generate existing content //if edit, then generate existing content
if(this.menuAction != null && this.menuAction == "Edit") { if(this.isEdit()) {
this.initExistingContent(); this.initExistingContent();
} }
}, },
isEdit:function() {
if(pageManagementUtils.menuAction != null && pageManagementUtils.menuAction == "Edit") {
return true;
}
return false;
},
isAdd:function() {
if(pageManagementUtils.menuAction != null && pageManagementUtils.menuAction == "Add") {
return true;
}
return false;
},
initExistingContent:function() { initExistingContent:function() {
this.generateExistingContentSections(); this.generateExistingContentSections();
//display more content button - will need to review how to hit save etc. //display more content button - will need to review how to hit save etc.
@ -120,9 +132,12 @@ var pageManagementUtils = {
this.classesForClassGroup.addClass('hidden'); this.classesForClassGroup.addClass('hidden');
this.moreContentButton.hide(); this.moreContentButton.hide();
//left side components //left side components
this.defaultTemplateRadio.attr('checked',true); //These depend on whether or not this is an existing item or not
this.isMenuCheckbox.attr('checked',false); if(this.isAdd()) {
this.menuSection.hide(); this.defaultTemplateRadio.attr('checked',true);
this.isMenuCheckbox.attr('checked',false);
this.menuSection.hide();
}
}, },
bindEventListeners:function(){ bindEventListeners:function(){
@ -131,7 +146,6 @@ var pageManagementUtils = {
pageManagementUtils.customTemplate.addClass('hidden'); pageManagementUtils.customTemplate.addClass('hidden');
//Also clear custom template value so as not to submit it //Also clear custom template value so as not to submit it
pageManagementUtils.clearInputs(pageManagementUtils.customTemplate); pageManagementUtils.clearInputs(pageManagementUtils.customTemplate);
}); });
this.customTemplateRadio.click( function() { this.customTemplateRadio.click( function() {
@ -231,13 +245,6 @@ var pageManagementUtils = {
pageManagementUtils.adjustSaveButtonHeight(); pageManagementUtils.adjustSaveButtonHeight();
}); });
/*
// Listeners for vClass switching
this.changeContentType.click(function() {
pageManagementUtils.showClassGroups();
return false;
});*/
//Submission: validate as well as create appropriate hidden json inputs //Submission: validate as well as create appropriate hidden json inputs
$("form").submit(function (event) { $("form").submit(function (event) {