From 0e3d7da64eee70229cdfd8fc9b45d5cf1f50ab8b Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Tue, 11 Dec 2012 00:23:05 +0100 Subject: [PATCH] Improving UserBasket category selection. --- .../modules/category/templates/indexSuccess.php | 30 +++++++++++++++------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/apps/userfront/modules/category/templates/indexSuccess.php b/apps/userfront/modules/category/templates/indexSuccess.php index cebfd7c..bdb4d3a 100644 --- a/apps/userfront/modules/category/templates/indexSuccess.php +++ b/apps/userfront/modules/category/templates/indexSuccess.php @@ -36,6 +36,14 @@ hierarchyCheck($(this), checkedInput); }); }); + + $(document).ready(function(){ + $('[id^=node]').each(function(data){ + if($(this).children('td').eq(1).find('input').is(':checked')) { + hierarchyCheck($(this), true); + } + }); + }); @@ -53,20 +61,24 @@ getNode(); - if ($node->isValidNode() && $node->hasParent() && ($node->getParent()->getId() != '1')) + if ($node->isValidNode() && $node->hasParent() && ($node->getParent()->getLevel() != '0')) { echo 'class="child-of-node-'.$node->getParent()->getId().'"'; } ?>> - getUserBaskets() as $userBasket): ?> - getUserId() == $userId): ?> - checked - - - - > + getLevel() != '0'): ?> + getUserBaskets() as $userBasket): ?> + getUserId() == $userId): ?> + checked + + + + > + + + -- 2.1.4