PageSourceSearch

https://www.cacheboutique.es/themes/cacheboutique16/js/tools/treeManagement.js

js cacheboutique.es collected 2026-10-08 11:15:24 UTC 2,961 bytes, 85 lines download raw bytes

1/*
2* 2007-2015 PrestaShop
3*
4* NOTICE OF LICENSE
5*
6* This source file is subject to the Academic Free License (AFL 3.0)
7* that is bundled with this package in the file LICENSE.txt.
8* It is also available through the world-wide-web at this URL:
9* http://opensource.org/licenses/afl-3.0.php
10* If you did not receive a copy of the license and are unable to
11* obtain it through the world-wide-web, please send an email
12* to [email protected] so we can send you a copy immediately.
13*
14* DISCLAIMER
15*
16* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
17* versions in the future. If you wish to customize PrestaShop for your
18* needs please refer to http://www.prestashop.com for more information.
19*
20*  @author PrestaShop SA <[email protected]>
21*  @copyright  2007-2015 PrestaShop SA
22*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
23*  International Registered Trademark & Property of PrestaShop SA
24*/
25$(document).ready(function(){
26	$('ul.tree.dhtml').hide();
27
28	//to do not execute this script as much as it's called...
29	if(!$('ul.tree.dhtml').hasClass('dynamized'))
30	{
31		//add growers to each ul.tree elements
32		$('ul.tree.dhtml ul').prev().before("<span class='grower OPEN'> </span>");
33		
34		//dynamically add the '.last' class on each last item of a branch
35		$('ul.tree.dhtml ul li:last-child, ul.tree.dhtml li:last-child').addClass('last');
36		
37		//collapse every expanded branch
38		$('ul.tree.dhtml span.grower.OPEN').addClass('CLOSE').removeClass('OPEN').parent().find('ul:first').hide();
39		$('ul.tree.dhtml').show();
40		
41		//open the tree for the selected branch
42			$('ul.tree.dhtml .selected').parents().each( function() {
43				if ($(this).is('ul'))
44					toggleBranch($(this).prev().prev(), true);
45			});
46			toggleBranch( $('ul.tree.dhtml .selected').prev(), true);
47		
48		//add a fonction on clicks on growers
49		$('ul.tree.dhtml span.grower').click(function(){
50			toggleBranch($(this));
51		});
52		//mark this 'ul.tree' elements as already 'dynamized'
53		$('ul.tree.dhtml').addClass('dynamized');
54
55		$('ul.tree.dhtml').removeClass('dhtml');
56	}
57});
58
59//animate the opening of the branch (span.grower jQueryElement)
60function openBranch(jQueryElement, noAnimation)
61{
62		jQueryElement.addClass('OPEN').removeClass('CLOSE');
63		if(noAnimation)
64			jQueryElement.parent().find('ul:first').show();
65		else
66			jQueryElement.parent().find('ul:first').slideDown();
67}
68//animate the closing of the branch (span.grower jQueryElement)
69function closeBranch(jQueryElement, noAnimation)
70{
71	jQueryElement.addClass('CLOSE').removeClass('OPEN');
72	if(noAnimation)
73		jQueryElement.parent().find('ul:first').hide();
74	else
75		jQueryElement.parent().find('ul:first').slideUp();
76}
77
78//animate the closing or opening of the branch (ul jQueryElement)
79function toggleBranch(jQueryElement, noAnimation)
80{
81	if(jQueryElement.hasClass('OPEN'))
82		closeBranch(jQueryElement, noAnimation);
83	else
84		openBranch(jQueryElement, noAnimation);
85}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.