summaryrefslogtreecommitdiff
path: root/www/js/MonitorCtrl.js
diff options
context:
space:
mode:
authorArjun Roychowdhury <pliablepixels@gmail.com>2015-10-08 11:14:43 -0400
committerArjun Roychowdhury <pliablepixels@gmail.com>2015-10-08 11:14:43 -0400
commite333d3adee02f3fe417c01234654163d51abec60 (patch)
treee8963de1d1150ae3daf58891df9d97cf6315b9a7 /www/js/MonitorCtrl.js
parente8a070188de7785fd1adc06c110afc2adcc3e458 (diff)
Fixes https://github.com/pliablepixels/zmNinja/issues/38 - wasn't handling boolean state correctly for enabled
Diffstat (limited to 'www/js/MonitorCtrl.js')
-rw-r--r--www/js/MonitorCtrl.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js
index 7f8679eb..68ae0438 100644
--- a/www/js/MonitorCtrl.js
+++ b/www/js/MonitorCtrl.js
@@ -38,9 +38,9 @@ angular.module('zmApp.controllers')
// and changing monitor function
//-----------------------------------------------------------------------
$scope.changeConfig = function (monitorName, monitorId, enabled, func) {
- var checked = "false";
+ var checked = false;
console.log("called with " + monitorId + ":" + enabled + ":" + func);
- if (enabled == '1') checked = "true";
+ if (enabled == '1') checked = true;
$scope.monFunctions = [
{
@@ -76,7 +76,7 @@ angular.module('zmApp.controllers')
$rootScope.zmPopup = $ionicPopup.show({
scope: $scope,
- template: '<ion-toggle ng-model="monfunc.myenabled" ng-checked="{{monfunc.myenabled}}" toggle-class="toggle-calm">Enabled</ion-toggle><ion-radio-fix ng-repeat="item in monFunctions" ng-value="item.value" ng-model="monfunc.myfunc"> {{item.text}} </ion-radio-fix>',
+ template: '<ion-toggle ng-model="monfunc.myenabled" ng-checked="monfunc.myenabled" toggle-class="toggle-calm">Enabled</ion-toggle><ion-radio-fix ng-repeat="item in monFunctions" ng-value="item.value" ng-model="monfunc.myfunc"> {{item.text}} </ion-radio-fix>',
title: 'Change Settings for ' + monitorName,