// Merge -> revision 8589
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8596 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -34,30 +34,39 @@ $(document).ready(function()
|
||||
cancelFilter();
|
||||
openCloseFilter();
|
||||
|
||||
// Click on color
|
||||
$('#layered_form input[type=button], #layered_form label.layered_color').live('click', function()
|
||||
{
|
||||
if (!$('\'input[name='+$(this).attr('name')+']:hidden\'').length)
|
||||
$('<input />').attr('type', 'hidden').attr('name', $(this).attr('name')).val($(this).attr('rel')).appendTo('#layered_form');
|
||||
else
|
||||
$('\'input[name='+$(this).attr('name')+']:hidden\'').remove();
|
||||
window.location = '#'+$(this).next().children(1).attr('href').replace(/https?:\/\/.*\/\d+-[^\/]+/, '');
|
||||
reloadContent();
|
||||
});
|
||||
|
||||
// Click on checkbox
|
||||
$('#layered_form input[type=checkbox]').live('click', function()
|
||||
{
|
||||
window.location = '#'+$(this).next().children(1).attr('href').replace(/https?:\/\/.*\/\d+-[^\/]+/, '');
|
||||
reloadContent();
|
||||
});
|
||||
|
||||
// Click on label
|
||||
$("label a").live({
|
||||
click: function() {
|
||||
if($(this).parent().parent().find('input').attr('disabled') == '')
|
||||
{
|
||||
window.location = '#'+this.href.replace(/https?:\/\/.*\/\d+-[^\/]+/, '');
|
||||
$(this).parent().parent().find('input').click();
|
||||
reloadContent();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
paginationButton();
|
||||
initLayered();
|
||||
reloadContent();
|
||||
});
|
||||
|
||||
function addSlider(type, data, unit)
|
||||
@@ -81,7 +90,14 @@ function initSliders()
|
||||
function initLayered()
|
||||
{
|
||||
initSliders();
|
||||
var params = document.location.toString();
|
||||
if (window.location.href.split('#').length == 2)
|
||||
{
|
||||
var params = window.location.href.split('#')[1];
|
||||
reloadContent('&selected_filters='+params, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
var params = window.location.href;
|
||||
params = friendlyUrl(params, 'long');
|
||||
params = params.split('#');
|
||||
params.shift();
|
||||
@@ -99,6 +115,8 @@ function initLayered()
|
||||
$('#'+val.split('=')[0]).click();
|
||||
}
|
||||
});
|
||||
reloadContent();
|
||||
}
|
||||
}
|
||||
|
||||
function updatelink(link)
|
||||
@@ -216,15 +234,14 @@ function openCloseFilter()
|
||||
});
|
||||
}
|
||||
|
||||
function reloadContent(params_plus)
|
||||
function reloadContent(params_plus, force)
|
||||
{
|
||||
if (typeof(allowReload) == 'undefined')
|
||||
if (typeof(allowReload) == 'undefined' && typeof(force) != 'undefined' && force != true)
|
||||
{
|
||||
allowReload = true;
|
||||
return;
|
||||
}
|
||||
|
||||
window.location = updatelink( window.location.href);
|
||||
for(i = 0; i < ajaxQueries.length; i++)
|
||||
ajaxQueries[i].abort();
|
||||
ajaxQueries = new Array();
|
||||
|
||||
Reference in New Issue
Block a user