Skip to content

Commit

Permalink
fixed bug in children list
Browse files Browse the repository at this point in the history
  • Loading branch information
tkleinke committed Apr 7, 2016
1 parent 11977e3 commit 2b648b3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/main/webapp/resources/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -1356,12 +1356,17 @@ function PlaceCtrl($scope, $rootScope, $routeParams, $location, $timeout, $http,
};

var removeChildrenFromMap = function() {
var places = $rootScope.activePlaces.slice();
for (var i in $scope.children) {
var index = places.indexOf($scope.children[i]);
if (index > -1)
places.splice(index, 1);
var places = $rootScope.activePlaces.slice();
var placesToRemove = [];
for (var i in places) {
if (places[i].mapType == "markerChild" || places[i].mapType == "markerChildInvisible")
placesToRemove.push(places[i]);
}
for (var i in placesToRemove) {
var index = places.indexOf(placesToRemove[i]);
places.splice(index, 1);
}

$rootScope.activePlaces = places;
};

Expand Down
2 changes: 2 additions & 0 deletions src/main/webapp/resources/js/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -825,9 +825,11 @@ directives.directive('gazMap', function($location, Place) {
$scope.shapeMap = {};
for (var i in $scope.markers)
$scope.markers[i].setMap(null);
$scope.markers = [];

for (var i in $scope.shapes)
$scope.shapes[i].setMap(null);
$scope.shapes = [];

if ($scope.places.length == 0) return;

Expand Down

0 comments on commit 2b648b3

Please sign in to comment.