|
|
|
@ -31,24 +31,16 @@ panelApp.directive('batTabs', function ($compile, $templateCache, $http) {
|
|
|
|
|
panes.push(pane);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// TODO: remove this (newVal === oldVal ?)
|
|
|
|
|
var first = true;
|
|
|
|
|
|
|
|
|
|
appContext.getDebug(function (result) {
|
|
|
|
|
$scope.enable = result;
|
|
|
|
|
|
|
|
|
|
$scope.$watch('enable', function (newVal, oldVal) {
|
|
|
|
|
// prevent refresh on initial pageload
|
|
|
|
|
if (first) {
|
|
|
|
|
first = false;
|
|
|
|
|
appContext.setDebug(newVal);
|
|
|
|
|
if (!newVal) {
|
|
|
|
|
$scope.lastPane = $scope.currentPane;
|
|
|
|
|
$scope.select($scope.panes[$scope.panes.length - 1]);
|
|
|
|
|
} else {
|
|
|
|
|
appContext.setDebug(newVal);
|
|
|
|
|
if (!newVal) {
|
|
|
|
|
$scope.lastPane = $scope.currentPane;
|
|
|
|
|
$scope.select($scope.panes[$scope.panes.length - 1]);
|
|
|
|
|
} else {
|
|
|
|
|
$scope.select($scope.lastPane);
|
|
|
|
|
}
|
|
|
|
|
$scope.select($scope.lastPane);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|