From 401977c0b431c756209c64620f74b87fdbb07a50 Mon Sep 17 00:00:00 2001 From: Matthieu Aubry Date: Wed, 7 Dec 2016 00:01:08 +1300 Subject: After Updating/Deleting/Adding a segment, force a refresh of the dashboard (#10969) the refresh is currently needed for several reasons as the Segmentation editor is not coded properly and does not just work without the page reload. Ideally we'll rewrite the Segment Editor in AngularJS later so this reload will not be needed. fixes https://github.com/piwik/piwik/issues/10626 Reverting https://github.com/piwik/piwik/commit/5daf6c2388693746f2a47a9e6c31276d0b423a4f part of https://github.com/piwik/piwik/commit/0c9c30b731ccbacf47e154b9f7a590af49e3d799 --- plugins/SegmentEditor/javascripts/Segmentation.js | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'plugins/SegmentEditor/javascripts/Segmentation.js') diff --git a/plugins/SegmentEditor/javascripts/Segmentation.js b/plugins/SegmentEditor/javascripts/Segmentation.js index 28280a1a5d..7930ae8c0e 100644 --- a/plugins/SegmentEditor/javascripts/Segmentation.js +++ b/plugins/SegmentEditor/javascripts/Segmentation.js @@ -1278,28 +1278,7 @@ $(document).ready(function() { segmentDefinition = cleanupSegmentDefinition(segmentDefinition); segmentDefinition = encodeURIComponent(segmentDefinition); - if (piwikHelper.isAngularRenderingThePage()) { - - angular.element(document).injector().invoke(function ($location, $rootScope) { - var $search = $location.search(); - - if (segmentDefinition !== $search.segment) { - // eg when using back button the date might be actually already changed in the URL and we do not - // want to change the URL again - $search.segment = segmentDefinition.replace(/%$/, '%25').replace(/%([^\d].)/g, "%25$1"); - $location.search($search); - setTimeout(function () { - try { - $rootScope.$apply(); - } catch (e) {} - }, 1); - } - - }); - return false; - } else { - return broadcast.propagateNewPage('segment=' + segmentDefinition, true); - } + return broadcast.propagateNewPage('segment=' + segmentDefinition, true); }; this.changeSegmentList = function () {}; -- cgit v1.2.3