Skip to content

Commit

Permalink
close detail view when selection changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Taco van Dijk authored and Taco van Dijk committed Aug 4, 2014
1 parent c4fc46e commit 3a25a8b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/js/collectionscontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,28 @@ 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
//so we can instruct open layers to update the markers.
$scope.$watch('Repository.spatialSelection',
function(newValue, oldValue)
{
updateTime(newValue);
updateTime(newValue);
},
true
);

$scope.$watch('Repository.timeSelection',
function(newValue, oldValue)
{

updateMarkers(newValue);
},
true
Expand Down
8 changes: 7 additions & 1 deletion src/js/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -160,4 +166,4 @@ function updateTime(collection)
.call(xAxis);


}
}

0 comments on commit 3a25a8b

Please sign in to comment.