// Merge -> revision 8984

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8988 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-10-03 15:48:07 +00:00
parent 79115b2572
commit ae5fc92bf7
60 changed files with 669 additions and 356 deletions
+29
View File
@@ -87,6 +87,7 @@ function initSliders()
function initLayered()
{
initSliders();
initLocationChange();
if (window.location.href.split('#').length == 2 && window.location.href.split('#')[1] != '')
{
var params = window.location.href.split('#')[1];
@@ -312,3 +313,31 @@ function reloadContent(params_plus)
});
ajaxQueries.push(ajaxQuery);
}
function initLocationChange(func, time) {
if(!time) time = 500;
var currLoc = '';
setInterval(function()
{
if(window.location.href != currLoc)
{
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(/^#(\/)?/, ''))
return;
if (window.location.href.split('#').length == 2 && window.location.href.split('#')[1] != '')
{
var params = window.location.href.split('#')[1];
reloadContent('&selected_filters='+params);
}
else
reloadContent('&selected_filters=#');
}
}, time);
}