// Merge -> revision 9221

This commit is contained in:
rMalie
2011-10-11 12:45:12 +00:00
parent b0cc80ad01
commit eeb5b16112
77 changed files with 1987 additions and 815 deletions
+20 -17
View File
@@ -265,7 +265,7 @@ function reloadContent(params_plus)
$('.category-product-count').html(result.categoryCount);
$('#product_list').html(result.productList).html();
$('#product_list').replaceWith(result.productList);
$('#product_list').css('opacity', '1');
$('div#pagination').html(result.pagination);
paginationButton();
@@ -310,35 +310,38 @@ function reloadContent(params_plus)
if (current_friendly_url == '#')
current_friendly_url = '#/';
window.location = current_friendly_url;
lockLocationChecking = true;
}
});
ajaxQueries.push(ajaxQuery);
}
function initLocationChange(func, time) {
function initLocationChange(func, time)
{
if(!time) time = 500;
var currLoc = '';
var current_friendly_url = getUrlParams();
setInterval(function()
{
if(window.location.href != currLoc)
if(getUrlParams() != current_friendly_url && !lockLocationChecking)
{
currLoc = window.location.href;
// Don't reload page if current_friendly_url and real url match
if (window.location.href.split('#').length == 2 && window.location.href.split('#')[1] != '')
current_url = '#'+window.location.href.split('#')[1];
else
current_url = '';
if (current_friendly_url.replace(/^#(\/)?/, '') == current_url.replace(/^#(\/)?/, ''))
if (current_friendly_url.replace(/^#(\/)?/, '') == getUrlParams().replace(/^#(\/)?/, ''))
return;
if (window.location.href.split('#').length == 2 && window.location.href.split('#')[1] != '')
{
var params = window.location.href.split('#')[1];
reloadContent('&selected_filters='+params);
lockLocationChecking = true;
reloadContent('&selected_filters='+getUrlParams().replace(/^#/, ''));
}
else
reloadContent('&selected_filters=#');
else {
lockLocationChecking = false;
current_friendly_url = getUrlParams();
}
}, time);
}
function getUrlParams()
{
var params = current_friendly_url;
if(window.location.href.split('#').length == 2 && window.location.href.split('#')[1] != '')
params = '#'+window.location.href.split('#')[1];
return params;
}