Skip to content

Commit

Permalink
SAK-26249 Syllabus: Calendar setting doesn't take the first time you …
Browse files Browse the repository at this point in the history
…save

git-svn-id: https://source.sakaiproject.org/svn/syllabus/trunk@309661 66ffb92e-73f9-0310-93c1-f5514f145a0a
  • Loading branch information
Bryan Holladay committed May 20, 2014
1 parent 3c2b093 commit e773aaa
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions syllabus/syllabus-app/src/webapp/syllabus/main_edit.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@
$('input').change(function() {
dataChanged = true;
});
});
function toggleCalendarCheckbox(postCheckbox){
Expand Down Expand Up @@ -139,6 +141,31 @@
return deleteClick();
}
}
function toggleAllCalendarOptions(toggleCheckbox){
$('.calendarBox').each(function(){
if(toggleCheckbox.checked){
//make sure that the post option is checked otherwise don't check it:
if($(this).parent().parent().find(".postBox:checked").length == 1){
this.checked = true;
}
}else{
this.checked = false;
}
});
}
function toggleAllPostOptions(toggleCheckbox){
$('.postBox').each(function(){
if(toggleCheckbox.checked){
this.checked = true;
}else{
this.checked = false;
//make sure calendar option is unchecked
$(this).parent().parent().find(".calendarBox").removeAttr("checked");
}
});
}
</script>
<div>
<span id="successInfo" class="success popupMessage" style="display:none; float: left;"></span>
Expand Down Expand Up @@ -241,19 +268,19 @@
<h:outputText value="#{msgs.mainEditHeaderInCalendar}"/>
<f:verbatim>
<br/>
<input type="checkbox" onchange="$('.calendarBox').not(':disabled').attr('checked', this.checked);"/>
<input type="checkbox" onchange="toggleAllCalendarOptions(this);"/>
</f:verbatim>
</h:panelGroup>
</f:facet>
<h:selectBooleanCheckbox styleClass="calendarBox" value="#{eachEntry.entry.linkCalendar}" title="#{msgs.selectThisCheckBoxCal}" disabled="#{!eachEntry.posted}" onchange="checkStartEndDates(this)"/>
<h:selectBooleanCheckbox styleClass="calendarBox" value="#{eachEntry.entry.linkCalendar}" title="#{msgs.selectThisCheckBoxCal}" onchange="checkStartEndDates(this)"/>
</h:column>
<h:column rendered="#{! SyllabusTool.displayNoEntryMsg}">
<f:facet name="header">
<h:panelGroup>
<h:outputText value="#{msgs.mainEditHeaderStatus}"/>
<f:verbatim>
<br/>
<input type="checkbox" onchange="$('.postBox').attr('checked', this.checked);"/>
<input type="checkbox" onchange="toggleAllPostOptions(this);"/>
</f:verbatim>
</h:panelGroup>
</f:facet>
Expand Down

0 comments on commit e773aaa

Please sign in to comment.