mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:03:30 +02:00
Removing $rootScope for device and control, not needed anymore.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
var _ = require('lodash')
|
||||
|
||||
module.exports = function DeviceControlCtrl($scope, $rootScope, DeviceService, GroupService, $location) {
|
||||
module.exports = function DeviceControlCtrl($scope, DeviceService, GroupService, $location) {
|
||||
|
||||
$scope.groupTracker = DeviceService.trackGroup($scope)
|
||||
|
||||
@@ -9,14 +9,14 @@ module.exports = function DeviceControlCtrl($scope, $rootScope, DeviceService, G
|
||||
$scope.kickDevice = function (device) {
|
||||
|
||||
// If we're trying to kick current device
|
||||
if (device.serial === $rootScope.device.serial) {
|
||||
if (device.serial === $scope.device.serial) {
|
||||
|
||||
// If there is more than one device left
|
||||
if ($scope.groupDevices.length > 1) {
|
||||
|
||||
// Control first free device first
|
||||
var firstFreeDevice = _.find($scope.groupDevices, function (dev) {
|
||||
return dev.serial !== $rootScope.device.serial
|
||||
return dev.serial !== $scope.device.serial
|
||||
})
|
||||
$scope.controlDevice(firstFreeDevice)
|
||||
|
||||
@@ -41,46 +41,4 @@ module.exports = function DeviceControlCtrl($scope, $rootScope, DeviceService, G
|
||||
$scope.controlDevice = function (device) {
|
||||
$location.path('/control/' + device.serial)
|
||||
}
|
||||
|
||||
}
|
||||
// $scope
|
||||
//, $routeParams
|
||||
//, $location
|
||||
//, DeviceService
|
||||
//, GroupService
|
||||
//, ControlService
|
||||
//) {
|
||||
// $scope.device = null
|
||||
// $scope.control = null
|
||||
// $scope.installation = null
|
||||
//
|
||||
// $scope.install = function($files) {
|
||||
// return $scope.control.install($files)
|
||||
// .then(function(tx) {
|
||||
// return tx.promise
|
||||
// .progressed(function(result) {
|
||||
// $scope.$apply(function() {
|
||||
// $scope.installation = result
|
||||
// })
|
||||
// })
|
||||
// .then(function(result) {
|
||||
// $scope.$apply(function() {
|
||||
// $scope.installation = result
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// }
|
||||
//
|
||||
// DeviceService.get($routeParams.serial, $scope)
|
||||
// .then(function(device) {
|
||||
// return GroupService.invite(device)
|
||||
// })
|
||||
// .then(function(device) {
|
||||
// $scope.device = device
|
||||
// $scope.control = ControlService.create(device, device.channel)
|
||||
// return device
|
||||
// })
|
||||
// .catch(function() {
|
||||
// $location.path('/')
|
||||
// })
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user