summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--www/js/MonitorModalCtrl.js18
-rw-r--r--www/templates/monitors-modal.html4
2 files changed, 12 insertions, 10 deletions
diff --git a/www/js/MonitorModalCtrl.js b/www/js/MonitorModalCtrl.js
index ad26e96a..7c363b7a 100644
--- a/www/js/MonitorModalCtrl.js
+++ b/www/js/MonitorModalCtrl.js
@@ -37,7 +37,7 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$
/* $ionicLoading.show({
template: $translate.instant('kNegotiatingStreamAuth') + '...',
animation: 'fade-in',
- showBackdrop: true,
+ showBackdrop: false,
duration: zm.loadingTimeout,
maxWidth: 300,
showDelay: 0
@@ -1037,9 +1037,9 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$
//-------------------------------------------------------------
// Turns on or off an alarm forcibly (mode true = on, false = off)
//-------------------------------------------------------------
- $scope.enableAlarm = function (mid, mode) {
+ $scope.triggerAlarm = function (mid, mode) {
- if (mode) // trigger alarm
+ if (mode == 'on') // trigger alarm
{
$rootScope.zmPopup = SecuredPopups.show('show', {
title: 'Confirm',
@@ -1047,7 +1047,7 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$
buttons: [{
text: $translate.instant('kButtonYes'),
onTap: function (e) {
- enableAlarm(mid, mode);
+ triggerAlarm(mid, mode);
}
},
{
@@ -1060,11 +1060,11 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$
});
} else
- enableAlarm(mid, mode);
+ triggerAlarm(mid, mode);
- function enableAlarm(mid, mode) {
+ function triggerAlarm(mid, mode) {
var apiurl = NVRDataModel.getLogin().apiurl;
- var c = mode ? "on" : "off";
+ var c = mode=='on' ? 'on' : 'off';
var alarmurl = apiurl + "/monitors/alarm/id:" + mid + "/command:" + c + ".json";
NVRDataModel.log("Invoking " + alarmurl);
@@ -1082,6 +1082,8 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$
noBackdrop: true,
duration: 2000,
});
+
+
},
function (error) {
@@ -1090,7 +1092,7 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$
noBackdrop: true,
duration: 3000,
});
- NVRDataModel.debug("Error in enableAlarm " + JSON.stringify(error));
+ NVRDataModel.debug("Error in triggerAlarm " + JSON.stringify(error));
});
}
diff --git a/www/templates/monitors-modal.html b/www/templates/monitors-modal.html
index 980e2384..0b6ec69c 100644
--- a/www/templates/monitors-modal.html
+++ b/www/templates/monitors-modal.html
@@ -148,12 +148,12 @@
</a>
</li>
<li ng-if="isToggleListMenu">
- <a href="" ng-click="enableAlarm(monitorId,true)">
+ <a href="" ng-click="triggerAlarm(monitorId,'on')">
<i class="icon ion-flash"></i>
</a>
</li>
<li ng-if="isToggleListMenu">
- <a href="" ng-click="enableAlarm(monitorId,false)">
+ <a href="" ng-click="triggerAlarm(monitorId,'off')">
<i class="icon ion-flash-off"></i>
</a>
</li>