From 64d2351e0af6dac865c3e7d2a7a50fe7e7494562 Mon Sep 17 00:00:00 2001 From: sgiehl <stefangiehl@gmail.com> Date: Tue, 15 Jan 2013 14:12:21 +0000 Subject: [PATCH] fixes #3671 update url hash when switching dashboard git-svn-id: http://dev.piwik.org/svn/trunk@7752 59fd770c-687e-43c8-a1e3-f5a4ff64c105 --- plugins/CoreHome/templates/broadcast.js | 11 +++++++++++ plugins/Dashboard/templates/dashboardObject.js | 2 ++ 2 files changed, 13 insertions(+) diff --git a/plugins/CoreHome/templates/broadcast.js b/plugins/CoreHome/templates/broadcast.js index 0cd5c75489..e157e52912 100644 --- a/plugins/CoreHome/templates/broadcast.js +++ b/plugins/CoreHome/templates/broadcast.js @@ -47,6 +47,11 @@ var broadcast = { */ forceReload: false, + /** + * Suppress content update on hash changing + */ + updateHashOnly: false, + /** * Initializes broadcast object * @return {void} @@ -82,6 +87,12 @@ var broadcast = { // Unbind any previously attached resize handlers $(window).off('resize'); + + // do not update content if it should be suppressed + if (broadcast.updateHashOnly) { + broadcast.updateHashOnly = false; + return; + } // hash doesn't contain the first # character. if( hash ) { diff --git a/plugins/Dashboard/templates/dashboardObject.js b/plugins/Dashboard/templates/dashboardObject.js index 37004269a3..9ab4159891 100644 --- a/plugins/Dashboard/templates/dashboardObject.js +++ b/plugins/Dashboard/templates/dashboardObject.js @@ -91,6 +91,8 @@ dashboardLayout = null; dashboardId = dashboardIdToLoad; piwikHelper.showAjaxLoading(); + broadcast.updateHashOnly = true; + broadcast.propagateAjax('?idDashboard='+dashboardIdToLoad); fetchLayout(generateLayout); buildMenu(); return this; -- GitLab