Added basic fatal message functionality.

This commit is contained in:
Gunther Brunner
2014-05-13 19:22:08 +09:00
parent 99ef24f93b
commit 1d44bf5da3
7 changed files with 81 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
module.exports = function ($scope, gettext, $routeParams, $location, DeviceService, GroupService, ControlService) {
module.exports = function ($scope, gettext, $routeParams, $location, DeviceService, GroupService, ControlService, FatalMessageService) {
var sharedTabs = [
{
@@ -122,4 +122,15 @@ module.exports = function ($scope, gettext, $routeParams, $location, DeviceServi
.catch(function () {
$location.path('/')
})
$scope.$watch('device.state', function (newValue, oldValue) {
if (newValue !== oldValue) {
if (oldValue === 'using') {
FatalMessageService.open(angular.copy($scope.device))
} else {
}
}
}, true)
}