r7346 - in dumbhippo/trunk/server/web: javascript/dh tags/3



Author: marinaz
Date: 2008-02-29 16:38:18 -0600 (Fri, 29 Feb 2008)
New Revision: 7346

Modified:
   dumbhippo/trunk/server/web/javascript/dh/actions.js
   dumbhippo/trunk/server/web/tags/3/accountEditTable.tag
Log:
Make sure we can check Google-enabled e-mails on and off and save the preference correctly.

Modified: dumbhippo/trunk/server/web/javascript/dh/actions.js
===================================================================
--- dumbhippo/trunk/server/web/javascript/dh/actions.js	2008-02-27 03:26:16 UTC (rev 7345)
+++ dumbhippo/trunk/server/web/javascript/dh/actions.js	2008-02-29 22:38:18 UTC (rev 7346)
@@ -340,7 +340,8 @@
 		  	    	 });
 }
 
-dh.actions.setGoogleServicedEmail = function(email, enabled) {
+dh.actions.setGoogleServicedEmail = function(email, checkboxId) {
+    enabled = document.getElementById(checkboxId).checked
    	dh.server.doPOST("setgoogleservicedemail",
    					 { "email" : email,
 				       "enabled" : enabled ? "true" : "false" },

Modified: dumbhippo/trunk/server/web/tags/3/accountEditTable.tag
===================================================================
--- dumbhippo/trunk/server/web/tags/3/accountEditTable.tag	2008-02-27 03:26:16 UTC (rev 7345)
+++ dumbhippo/trunk/server/web/tags/3/accountEditTable.tag	2008-02-29 22:38:18 UTC (rev 7346)
@@ -167,22 +167,25 @@
 		<div id="dhGoogleServices"
 			class="dh-account-preferences-row">
 			<table>
-			 	<c:forEach items="${account.person.allEmails}" var="email">
+			 	<c:forEach items="${account.person.allEmails}" var="email" varStatus="loopStatus">
 				<tr>
 					<td><c:out value="${email.email}" /></td>
 					<td>
+					    <c:set var="checkboxId" value="dhGoogleEnabledEmail${loopStatus.count}"/>
 						<c:choose>
 							<c:when test="${dh:containerHas(account.person.dmo.googleEnabledEmails, email.email)}">
 								<jsp:element name="input">
 									<jsp:attribute name="type">checkbox</jsp:attribute>
-									<jsp:attribute name="onclick">dh.actions.setGoogleServicedEmail(<dh:jsString value="${email.email}" />, false)</jsp:attribute>
+									<jsp:attribute name="id"><c:out value="${checkboxId}"/></jsp:attribute>
+									<jsp:attribute name="onclick">dh.actions.setGoogleServicedEmail(<dh:jsString value="${email.email}" />, <dh:jsString value="${checkboxId}" />)</jsp:attribute>
 									<jsp:attribute name="checked">true</jsp:attribute>
 								</jsp:element>
 							</c:when>
 							<c:otherwise>
 								<jsp:element name="input">
 									<jsp:attribute name="type">checkbox</jsp:attribute>
-									<jsp:attribute name="onclick">dh.actions.setGoogleServicedEmail(<dh:jsString value="${email.email}" />, true)</jsp:attribute>
+									<jsp:attribute name="id"><c:out value="${checkboxId}"/></jsp:attribute>
+									<jsp:attribute name="onclick">dh.actions.setGoogleServicedEmail(<dh:jsString value="${email.email}" />, <dh:jsString value="${checkboxId}"/>)</jsp:attribute>
 								</jsp:element>								
 							</c:otherwise>
 						</c:choose>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]