Add basic context-menu for actions.

This commit is contained in:
Gunther Brunner
2014-09-25 16:24:57 +09:00
parent c33d95ba7a
commit f705cd60a7
9 changed files with 86 additions and 4 deletions

View File

@@ -95,4 +95,32 @@ module.exports = function DeviceControlCtrl($scope, DeviceService, GroupService,
$scope.currentRotation = 'landscape'
}
})
// TODO: Refactor this inside control and server-side
$scope.rotateLeft = function () {
var angle = 0
if ($scope.device && $scope.device.display) {
angle = $scope.device.display.rotation
}
if (angle === 0) {
angle = 270
} else {
angle -= 90
}
$scope.control.rotate(angle)
}
$scope.rotateRight = function () {
var angle = 0
if ($scope.device && $scope.device.display) {
angle = $scope.device.display.rotation
}
if (angle === 270) {
angle = 0
} else {
angle += 90
}
$scope.control.rotate(angle)
}
}