Author: pranayp
Date: Sat Sep 17 11:04:58 2016 New Revision: 1761195 URL: http://svn.apache.org/viewvc?rev=1761195&view=rev Log: Improved: Ecommerce, Ebay - inline js for toggleAll, checkToggle and selectAll calling from ftls (OFBIZ-7931) Removed inline js for toggleAll, checkToggle and selectAll calling from ftls in Ecommerce and Ebay component. Add class="selectAll" on parent checkbox element for select all functionality. Thanks: Amardeep Singh Jhajj for reporting and providing the patch. Modified: ofbiz/trunk/specialpurpose/ebay/template/find/EbayKeywordSearch.ftl ofbiz/trunk/specialpurpose/ecommerce/template/cart/ShowCart.ftl ofbiz/trunk/specialpurpose/ecommerce/template/order/RequestReturn.ftl Modified: ofbiz/trunk/specialpurpose/ebay/template/find/EbayKeywordSearch.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/template/find/EbayKeywordSearch.ftl?rev=1761195&r1=1761194&r2=1761195&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ebay/template/find/EbayKeywordSearch.ftl (original) +++ ofbiz/trunk/specialpurpose/ebay/template/find/EbayKeywordSearch.ftl Sat Sep 17 11:04:58 2016 @@ -39,28 +39,10 @@ under the License. </#if> <#if productIds?has_content> - <script language="JavaScript" type="text/javascript"> - //<![CDATA[ - function toggleAll(e) { - var cform = document.products; - var len = cform.elements.length; - for (var i = 0; i < len; i++) { - var element = cform.elements[i]; - if (element.name == "selectResult" && element.checked != e.checked) { - toggle(element); - } - } - } - - function toggle(e) { - e.checked = !e.checked; - } - //]]> - </script> <#macro paginationPanel> <div class="clearfix"> <div class="lefthalf margin-left"> - <input type="checkbox" name="selectAll" value="0" onclick="javascript:toggleAll(this);"/> + <input type="checkbox" name="selectAll" value="0" class="selectAll" form="products"/> <strong>${uiLabelMap.ProductProduct}</strong> </div> <div class="right"> @@ -88,7 +70,7 @@ under the License. </div> </#macro> <@paginationPanel /> - <form method="post" name="products" action=""> + <form method="post" name="products" action="" id="products"> <fieldset> <input type="hidden" name="productStoreId" value="${parameters.productStoreId!}" /> <input type="hidden" name="SEARCH_CATEGORY_ID" value="${(requestParameters.SEARCH_CATEGORY_ID)!}" /> Modified: ofbiz/trunk/specialpurpose/ecommerce/template/cart/ShowCart.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/template/cart/ShowCart.ftl?rev=1761195&r1=1761194&r2=1761195&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/template/cart/ShowCart.ftl (original) +++ ofbiz/trunk/specialpurpose/ecommerce/template/cart/ShowCart.ftl Sat Sep 17 11:04:58 2016 @@ -18,35 +18,6 @@ under the License. --> <script type="text/javascript"> //<![CDATA[ - function toggle(e) { - e.checked = !e.checked; - } - function checkToggle(e) { - var cform = document.cartform; - if (e.checked) { - var len = cform.elements.length; - var allchecked = true; - for (var i = 0; i < len; i++) { - var element = cform.elements[i]; - if (element.name == "selectedItem" && !element.checked) { - allchecked = false; - } - cform.selectAll.checked = allchecked; - } - } else { - cform.selectAll.checked = false; - } - } - function toggleAll(e) { - var cform = document.cartform; - var len = cform.elements.length; - for (var i = 0; i < len; i++) { - var element = cform.elements[i]; - if (element.name == "selectedItem" && element.checked != e.checked) { - toggle(element); - } - } - } function removeSelected() { var cform = document.cartform; cform.removeSelected.value = true; @@ -242,7 +213,7 @@ under the License. <th scope="row">${uiLabelMap.EcommerceAdjustments}</th> <th scope="row">${uiLabelMap.EcommerceItemTotal}</th> <th scope="row"> - <input type="checkbox" name="selectAll" value="0" onclick="javascript:toggleAll(this);" /> + <input type="checkbox" name="selectAll" value="0" class="selectAll"/> </th> </tr> </thead> @@ -471,8 +442,7 @@ under the License. <td><@ofbizCurrency amount=cartLine.getDisplayItemSubTotal() isoCode=shoppingCart.getCurrency()/></td> <td> <#if !cartLine.getIsPromo()> - <input type="checkbox" name="selectedItem" value="${cartLineIndex}" - onclick="javascript:checkToggle(this);" /> + <input type="checkbox" name="selectedItem" value="${cartLineIndex}" class="selectAllChild"/> <#else> </#if> Modified: ofbiz/trunk/specialpurpose/ecommerce/template/order/RequestReturn.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/template/order/RequestReturn.ftl?rev=1761195&r1=1761194&r2=1761195&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/template/order/RequestReturn.ftl (original) +++ ofbiz/trunk/specialpurpose/ecommerce/template/order/RequestReturn.ftl Sat Sep 17 11:04:58 2016 @@ -42,7 +42,7 @@ under the License. <td colspan="5"><h3>${uiLabelMap.OrderReturnItemsFromOrder} ${uiLabelMap.CommonNbr}<a href="<@ofbizUrl>orderstatus?orderId=${orderId}</@ofbizUrl>" class="buttontext">${orderId}</h3></td> <td align="right"> <span class="tableheadtext">${uiLabelMap.CommonSelectAll}</span> - <input type="checkbox" name="selectAll" value="Y" onclick="javascript:toggleAll(this, 'selectAllForm');"/> + <input type="checkbox" name="selectAll" value="Y" class="selectAll"/> </td> </tr> <tr> @@ -103,7 +103,7 @@ under the License. </select> </td> <td align="right"> - <input type="checkbox" name="_rowSubmit_o_${rowCount}" value="Y" onclick="javascript:checkToggle(this, 'selectAllForm');"/> + <input type="checkbox" name="_rowSubmit_o_${rowCount}" value="Y"/> </td> </tr> <tr><td colspan="6"><hr /></td></tr> |
Free forum by Nabble | Edit this page |