Starting to add Timeline notifications.

This commit is contained in:
Gunther Brunner
2014-05-12 17:47:19 +09:00
parent 7f94b0beef
commit e4e5109533
14 changed files with 253 additions and 37 deletions

View File

@@ -1,3 +1,39 @@
module.exports = function ActivityCtrl($scope) {
module.exports = function ActivityCtrl($scope, gettext, TimelineService) {
$scope.timeline = TimelineService
$scope.$watch('device.state', function (newValue, oldValue) {
if (newValue !== oldValue) {
var title = ''
var message = ''
if (oldValue === 'using') {
title = newValue
message = 'Device is now ' + newValue
} else {
title = newValue
message = '!Device is now ' + newValue
}
$scope.timeline.info({
title: title,
message: message,
serial: $scope.device.serial
})
// $scope.timeline.push({
// title: title,
// message: message,
// serial: angular.copy($scope.device.serial),
// time: Date.now()
// })
}
}, true)
}