// Merge -> revision 8552
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8554 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -81,10 +81,13 @@ function initSliders()
|
||||
function initLayered()
|
||||
{
|
||||
initSliders();
|
||||
var params = document.location.toString().split('#');
|
||||
var params = document.location.toString();
|
||||
params = friendlyUrl(params, 'long');
|
||||
params = params.split('#');
|
||||
params.shift();
|
||||
$(params).each(function(it, val)
|
||||
{
|
||||
allowReload = true;
|
||||
if (val.split('=')[0] == 'price' || val.split('=')[0] == 'weight')
|
||||
{
|
||||
$("#layered_"+val.split('=')[0]+"_slider").slider('values', 0, val.split('=')[1].split('_')[0]);
|
||||
@@ -102,6 +105,7 @@ function updatelink(link)
|
||||
{
|
||||
baseUrl = link.split('#');
|
||||
linkFilterUpdate = baseUrl[0]+getValueSelected();
|
||||
linkFilterUpdate = friendlyUrl(linkFilterUpdate, 'short');
|
||||
return linkFilterUpdate;
|
||||
}
|
||||
|
||||
@@ -126,6 +130,32 @@ function getValueSelected(){
|
||||
return checkboxChecked;
|
||||
}
|
||||
|
||||
function friendlyUrl(link, encode)
|
||||
{
|
||||
var friendlyTab = {
|
||||
'layered_condition_' : 'cond_',
|
||||
'layered_id_attribute_group_' : 'g_',
|
||||
'id_category_layered=' : 'c=',
|
||||
'layered_manufacturer_' : 'm_',
|
||||
'layered_id_feature_' : 'f_',
|
||||
'layered_category_' : 'cat_',
|
||||
};
|
||||
|
||||
if(encode == 'short'){
|
||||
$.each(friendlyTab, function(key, value) {
|
||||
Expression = new RegExp(key,'g');
|
||||
link = link.replace(Expression, value);
|
||||
});
|
||||
}else{
|
||||
$.each(friendlyTab, function(key, value) {
|
||||
Expression = new RegExp(value,'g');
|
||||
link = link.replace(Expression, key);
|
||||
});
|
||||
}
|
||||
|
||||
return link;
|
||||
}
|
||||
|
||||
function paginationButton() {
|
||||
$('#pagination li').not('.current, .disabled').each( function () {
|
||||
var nbPage = 0;
|
||||
@@ -188,6 +218,12 @@ function openCloseFilter()
|
||||
|
||||
function reloadContent(params_plus)
|
||||
{
|
||||
if (typeof(allowReload) == 'undefined')
|
||||
{
|
||||
allowReload = true;
|
||||
return;
|
||||
}
|
||||
|
||||
window.location = updatelink( window.location.href);
|
||||
for(i = 0; i < ajaxQueries.length; i++)
|
||||
ajaxQueries[i].abort();
|
||||
|
||||
Reference in New Issue
Block a user