mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:03:30 +02:00
Add basic context-menu for actions.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user