diff --git a/app/controller/DashboardController.js b/app/controller/DashboardController.js index 34c042d..9c07357 100644 --- a/app/controller/DashboardController.js +++ b/app/controller/DashboardController.js @@ -2,6 +2,7 @@ define( function () { function DashboardController($scope, $rootScope, esFactory, ESService, ModalService, Notification) { angular.element(document).ready(function () { + $scope.$parent.navVisible = false; var generatorQueries = genES() var builderData = builderESDS() @@ -216,11 +217,11 @@ define( console.log("cargar dash:", dashtoadd); // Remove current dashboard (removing just the children) - for (var i = 0; i < $rootScope.actualdash.children.length; i++) { - if ($rootScope.actualdash.children[i].id !== "skymap") { - $rootScope.actualdash.removeChild($rootScope.actualdash.children[i]) - } - }; + backgroundNoDelete = document.getElementById("skymap") + while ($rootScope.actualdash.firstChild) { + $rootScope.actualdash.removeChild($rootScope.actualdash.firstChild); + } + $rootScope.actualdash.appendChild(backgroundNoDelete) // Pintar background if (dashtoadd._source.background) { diff --git a/app/controller/ShowListController.js b/app/controller/ShowListController.js index a0d08ba..79254c1 100644 --- a/app/controller/ShowListController.js +++ b/app/controller/ShowListController.js @@ -2,6 +2,7 @@ define( function () { function ShowListController($scope, $route, $routeParams, $location, esFactory, ESService, ModalService, Notification) { angular.element(document).ready(function () { + $scope.$parent.navVisible = false; var generatorQueries = genES() var builderData = builderESDS() diff --git a/app/controller/TabsController.js b/app/controller/TabsController.js index 635485c..7aaa20a 100644 --- a/app/controller/TabsController.js +++ b/app/controller/TabsController.js @@ -5,9 +5,9 @@ define( // Clean dashboard const removeVisualizations = (dash) => { if (dash) { - for (var i = 0; i < dash.children.length; i++) { - dash.removeChild(dash.children[i]) - }; + while (dash.firstChild) { + dash.removeChild(dash.firstChild); + } } }