From: Gustavo Martin Morcuende Date: Mon, 10 Dec 2012 23:23:05 +0000 (+0100) Subject: Improving UserBasket category selection. X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=0e3d7da64eee70229cdfd8fc9b45d5cf1f50ab8b;p=mobi%2F.git Improving UserBasket category selection. --- 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 + + + + > + + +