2017-08-29 09:50:32 +02:00

55 lines
1.6 KiB
Smarty
Executable File

{if count($attr) > 0}
<div class="block_filter">
<div class="content">
<h4 class="open">{l s='Recherche par' mod='filtervp'}</h4>
<div class="content_filter">
<h5>{$attr[0]['group']}</h5>
{assign var="current_name" value=$attr[0]['group']}
<ul class="filters" id="filters">
{foreach from=$attr key=key item=attribute}
{if $key!=0 && $current_name!=$attribute['group']}
</ul>
<h5>{$attribute['group']}</h5>
<ul class="filters">
{/if}
<li>
<input type="checkbox" name="size" value="{$attribute['id_attribute']}" id="size_{$attribute['id_attribute']}">
<label for="size_{$attribute['id_attribute']}">{$attribute['name']}</label>
</li>
{assign var="current_name" value=$attribute['group']}
{/foreach}
</ul>
</div>
</div>
</div>
{/if}
<script>
{literal}
$(document).ready(function() {
$('.open').live('click', function(e){
e.preventDefault();
if($('#privatesales_categories_block_left').length>0) {
$('.block_filter .content').css({'position':'relative'});
var new_top = $('#privatesales_categories_block_left').position().top;
}
$(this).toggleClass('active');
$('.content_filter').toggle();
if($('#privatesales_categories_block_left').length>0) {
if($(this).hasClass('active') == true) {
new_top = $('#privatesales_categories_block_left').position().top + $('.block_filter .content_filter').height() + 25;
} else {
new_top = $('.block_filter').position().top + $('.block_filter').height();
}
$('#privatesales_categories_block_left').css({'top': new_top});
}
});
});
{/literal}
</script>