diff --git a/ui/src/app/alarm/alarm-row.directive.js b/ui/src/app/alarm/alarm-row.directive.js
index 09c04f9594..62bed1117a 100644
--- a/ui/src/app/alarm/alarm-row.directive.js
+++ b/ui/src/app/alarm/alarm-row.directive.js
@@ -44,6 +44,7 @@ export default function AlarmRowDirective($compile, $templateCache, types, $mdDi
alarmId: scope.alarm.id.id,
allowAcknowledgment: true,
allowClear: true,
+ displayDetails: true,
showingCallback: onShowingCallback
},
parent: angular.element($document[0].body),
diff --git a/ui/src/app/dashboard/states/default-state-controller.js b/ui/src/app/dashboard/states/default-state-controller.js
index 8d85c59aeb..6f5172417d 100644
--- a/ui/src/app/dashboard/states/default-state-controller.js
+++ b/ui/src/app/dashboard/states/default-state-controller.js
@@ -22,6 +22,8 @@ export default function DefaultStateController($scope, $timeout, $location, $sta
vm.inited = false;
+ vm.skipStateChange = false;
+
vm.openState = openState;
vm.updateState = updateState;
vm.resetState = resetState;
@@ -48,10 +50,9 @@ export default function DefaultStateController($scope, $timeout, $location, $sta
params: params
}
//append new state
- stopWatchStateObject();
vm.stateObject[0] = newState;
gotoState(vm.stateObject[0].id, true, openRightLayout);
- watchStateObject();
+ vm.skipStateChange = true;
}
}
@@ -68,10 +69,9 @@ export default function DefaultStateController($scope, $timeout, $location, $sta
params: params
}
//replace with new state
- stopWatchStateObject();
vm.stateObject[0] = newState;
gotoState(vm.stateObject[0].id, true, openRightLayout);
- watchStateObject();
+ vm.skipStateChange = true;
}
}
@@ -87,10 +87,9 @@ export default function DefaultStateController($scope, $timeout, $location, $sta
function navigatePrevState(index) {
if (index < vm.stateObject.length-1) {
- stopWatchStateObject();
vm.stateObject.splice(index+1, vm.stateObject.length-index-1);
gotoState(vm.stateObject[vm.stateObject.length-1].id, true);
- watchStateObject();
+ vm.skipStateChange = true;
}
}
@@ -221,31 +220,23 @@ export default function DefaultStateController($scope, $timeout, $location, $sta
$scope.$watch('vm.dashboardCtrl.dashboardCtx.state', function () {
if (vm.stateObject[0].id !== vm.dashboardCtrl.dashboardCtx.state) {
- stopWatchStateObject();
vm.stateObject[0].id = vm.dashboardCtrl.dashboardCtx.state;
updateLocation();
- watchStateObject();
+ vm.skipStateChange = true;
}
});
- watchStateObject();
+ $scope.$watch('vm.stateObject', function(newVal, prevVal) {
+ if (!angular.equals(newVal, prevVal) && newVal) {
+ if (vm.skipStateChange) {
+ vm.skipStateChange = false;
+ } else {
+ gotoState(vm.stateObject[0].id, true);
+ }
+ }
+ }, true);
});
}
- function stopWatchStateObject() {
- if (vm.stateObjectWatcher) {
- vm.stateObjectWatcher();
- vm.stateObjectWatcher = null;
- }
- }
-
- function watchStateObject() {
- vm.stateObjectWatcher = $scope.$watch('vm.stateObject', function(newVal, prevVal) {
- if (!angular.equals(newVal, prevVal) && newVal) {
- gotoState(vm.stateObject[0].id, true);
- }
- }, true);
- }
-
function gotoState(stateId, update, openRightLayout) {
if (vm.dashboardCtrl.dashboardCtx.state != stateId) {
vm.dashboardCtrl.openDashboardState(stateId, openRightLayout);
diff --git a/ui/src/app/dashboard/states/entity-state-controller.js b/ui/src/app/dashboard/states/entity-state-controller.js
index ba2bc64149..527cd08f54 100644
--- a/ui/src/app/dashboard/states/entity-state-controller.js
+++ b/ui/src/app/dashboard/states/entity-state-controller.js
@@ -24,6 +24,8 @@ export default function EntityStateController($scope, $timeout, $location, $stat
vm.inited = false;
+ vm.skipStateChange = false;
+
vm.openState = openState;
vm.updateState = updateState;
vm.resetState = resetState;
@@ -50,11 +52,10 @@ export default function EntityStateController($scope, $timeout, $location, $stat
params: params
}
//append new state
- stopWatchStateObject();
vm.stateObject.push(newState);
vm.selectedStateIndex = vm.stateObject.length-1;
gotoState(vm.stateObject[vm.stateObject.length-1].id, true, openRightLayout);
- watchStateObject();
+ vm.skipStateChange = true;
}
);
}
@@ -73,10 +74,9 @@ export default function EntityStateController($scope, $timeout, $location, $stat
params: params
}
//replace with new state
- stopWatchStateObject();
vm.stateObject[vm.stateObject.length - 1] = newState;
gotoState(vm.stateObject[vm.stateObject.length - 1].id, true, openRightLayout);
- watchStateObject();
+ vm.skipStateChange = true;
}
);
}
@@ -94,11 +94,10 @@ export default function EntityStateController($scope, $timeout, $location, $stat
function navigatePrevState(index) {
if (index < vm.stateObject.length-1) {
- stopWatchStateObject();
vm.stateObject.splice(index+1, vm.stateObject.length-index-1);
vm.selectedStateIndex = vm.stateObject.length-1;
gotoState(vm.stateObject[vm.stateObject.length-1].id, true);
- watchStateObject();
+ vm.skipStateChange = true;
}
}
@@ -266,14 +265,22 @@ export default function EntityStateController($scope, $timeout, $location, $stat
$scope.$watch('vm.dashboardCtrl.dashboardCtx.state', function () {
if (vm.stateObject[vm.stateObject.length - 1].id !== vm.dashboardCtrl.dashboardCtx.state) {
- stopWatchStateObject();
vm.stateObject[vm.stateObject.length - 1].id = vm.dashboardCtrl.dashboardCtx.state;
updateLocation();
- watchStateObject();
+ vm.skipStateChange = true;
}
});
- watchStateObject();
+ $scope.$watch('vm.stateObject', function(newVal, prevVal) {
+ if (!angular.equals(newVal, prevVal) && newVal) {
+ if (vm.skipStateChange) {
+ vm.skipStateChange = false;
+ } else {
+ vm.selectedStateIndex = vm.stateObject.length - 1;
+ gotoState(vm.stateObject[vm.stateObject.length - 1].id, true);
+ }
+ }
+ }, true);
if (vm.dashboardCtrl.isMobile) {
watchSelectedStateIndex();
@@ -292,22 +299,6 @@ export default function EntityStateController($scope, $timeout, $location, $stat
}
- function stopWatchStateObject() {
- if (vm.stateObjectWatcher) {
- vm.stateObjectWatcher();
- vm.stateObjectWatcher = null;
- }
- }
-
- function watchStateObject() {
- vm.stateObjectWatcher = $scope.$watch('vm.stateObject', function(newVal, prevVal) {
- if (!angular.equals(newVal, prevVal) && newVal) {
- vm.selectedStateIndex = vm.stateObject.length-1;
- gotoState(vm.stateObject[vm.stateObject.length-1].id, true);
- }
- }, true);
- }
-
function stopWatchSelectedStateIndex() {
if (vm.selectedStateIndexWatcher) {
vm.selectedStateIndexWatcher();
diff --git a/ui/src/app/widget/lib/alarms-table-widget.js b/ui/src/app/widget/lib/alarms-table-widget.js
index 10e7aa3bc1..3af7ac7e8d 100644
--- a/ui/src/app/widget/lib/alarms-table-widget.js
+++ b/ui/src/app/widget/lib/alarms-table-widget.js
@@ -333,6 +333,7 @@ function AlarmsTableWidgetController($element, $scope, $filter, $mdMedia, $mdDia
alarmId: alarm.id.id,
allowAcknowledgment: vm.allowAcknowledgment,
allowClear: vm.allowClear,
+ displayDetails: true,
showingCallback: onShowingCallback
},
parent: angular.element($document[0].body),