From 3a25a8b5d4aa569c4b3cbff872aeccffba49050e Mon Sep 17 00:00:00 2001 From: Taco van Dijk Date: Mon, 4 Aug 2014 16:35:52 +0200 Subject: [PATCH] close detail view when selection changes --- src/js/collectionscontroller.js | 9 ++++++++- src/js/time.js | 8 +++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/js/collectionscontroller.js b/src/js/collectionscontroller.js index fe5ac0e..e7107f8 100644 --- a/src/js/collectionscontroller.js +++ b/src/js/collectionscontroller.js @@ -33,6 +33,12 @@ angular.module('elviewer').controller('CollectionsController', ['$scope', 'Repos { Repository.spatialSelection = Repository.defaultCollection; } + + //TODO: find better solution + if(window.location.href.indexOf('item') != -1) + { + window.location.href = "#/"; + } },true); //we want to know when the collection changes @@ -40,7 +46,7 @@ angular.module('elviewer').controller('CollectionsController', ['$scope', 'Repos $scope.$watch('Repository.spatialSelection', function(newValue, oldValue) { - updateTime(newValue); + updateTime(newValue); }, true ); @@ -48,6 +54,7 @@ angular.module('elviewer').controller('CollectionsController', ['$scope', 'Repos $scope.$watch('Repository.timeSelection', function(newValue, oldValue) { + updateMarkers(newValue); }, true diff --git a/src/js/time.js b/src/js/time.js index 788b6f9..bafce34 100644 --- a/src/js/time.js +++ b/src/js/time.js @@ -72,6 +72,12 @@ function onYearClick(year) barElement.setAttribute("class","bar-selected"); } scope.$apply(); + + //TODO: find better solution + if(window.location.href.indexOf('item') != -1) + { + window.location.href = "#/"; + } } //returns if the year is enabled in the current selection @@ -160,4 +166,4 @@ function updateTime(collection) .call(xAxis); -} \ No newline at end of file +}