mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 00:23:25 +02:00
- Finally, most of the unit tests now passes (resolving dependencies also).
- Shims now exports angular module name, however some of them clash with the original.
This commit is contained in:
@@ -2,19 +2,22 @@ module.exports = function DeviceSettingsCtrl($scope, $timeout) {
|
||||
$scope.wifiEnabled = true
|
||||
|
||||
var getWifiStatus = function () {
|
||||
$scope.control.getWifiStatus().then(function (result) {
|
||||
$scope.$apply(function () {
|
||||
$scope.wifiEnabled = (result.lastData === 'wifi_enabled')
|
||||
if ($scope.control) {
|
||||
$scope.control.getWifiStatus().then(function (result) {
|
||||
$scope.$apply(function () {
|
||||
$scope.wifiEnabled = (result.lastData === 'wifi_enabled')
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
getWifiStatus()
|
||||
|
||||
$scope.toggleWifi = function () {
|
||||
$scope.control.setWifiEnabled(!$scope.wifiEnabled)
|
||||
$scope.wifiEnabled = !$scope.wifiEnabled
|
||||
$timeout(getWifiStatus, 500)
|
||||
if ($scope.control) {
|
||||
$scope.control.setWifiEnabled(!$scope.wifiEnabled)
|
||||
$scope.wifiEnabled = !$scope.wifiEnabled
|
||||
$timeout(getWifiStatus, 500)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user