diff options
| author | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-10-11 16:47:00 -0400 |
|---|---|---|
| committer | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-10-11 16:47:00 -0400 |
| commit | 144df72c5b65f076f48bab0b451c8dbc4ea2da9b (patch) | |
| tree | 13c3e50a3bf7a4527949c279aee3fc4737a206e2 /www/js | |
| parent | d0d3aaf7af63afa041e9af145267b0bb04ee729f (diff) | |
https://github.com/pliablepixels/zmNinja/issues/41
Diffstat (limited to 'www/js')
| -rw-r--r-- | www/js/DataModel.js | 10 | ||||
| -rw-r--r-- | www/js/ModalCtrl.js | 33 |
2 files changed, 41 insertions, 2 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 51b2c9a3..400cebfa 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -39,6 +39,7 @@ angular.module('zmApp.controllers').service('ZMDataModel', 'enableDebug':false, // if enabled with log messages with "debug" 'usePin':false, 'pinCode':'', + 'canSwipeMonitors':true }; var configParams = { 'ZM_EVENT_IMAGE_DIGITS':'-1', @@ -153,6 +154,8 @@ angular.module('zmApp.controllers').service('ZMDataModel', + + if (window.localStorage.getItem("username") != undefined) { loginData.username = @@ -236,6 +239,12 @@ angular.module('zmApp.controllers').service('ZMDataModel', } + if (window.localStorage.getItem("canSwipeMonitors") != undefined) { + var canSwipeValue = window.localStorage.getItem("canSwipeMonitors"); + loginData.canSwipeMonitors = (canSwipeValue == "1") ? true:false; + } + + if (window.localStorage.getItem("usePin") != undefined) { var pinValue = window.localStorage.getItem("usePin"); loginData.usePin = (pinValue == "1") ? true:false; @@ -348,6 +357,7 @@ angular.module('zmApp.controllers').service('ZMDataModel', window.localStorage.setItem("eventServer", loginData.eventServer); window.localStorage.setItem("useSSL", loginData.useSSL?"1":"0"); window.localStorage.setItem("usePin", loginData.usePin?"1":"0"); + window.localStorage.setItem("canSwipeMonitors", loginData.canSwipeMonitors?"1":"0"); window.localStorage.setItem("pinCode", loginData.pinCode); diff --git a/www/js/ModalCtrl.js b/www/js/ModalCtrl.js index c1ce47a9..9cba8697 100644 --- a/www/js/ModalCtrl.js +++ b/www/js/ModalCtrl.js @@ -303,8 +303,24 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco }; - // not being used anymore - using a dedicated menu instead + $scope.onTapLeft = function (m,d) + { + ZMDataModel.zmDebug("ModalCtrl:Left tap detected, moving to " + ZMDataModel.getNextMonitor(m, d)); + $scope.monitorId = ZMDataModel.getNextMonitor(m, d); + + + $ionicLoading.hide(); + $ionicLoading.show({ + template: "please wait...", + noBackdrop: true, + duration: zm.loadingTimeout, + }); + }; + $scope.onSwipeLeft = function (m, d) { + var ld = ZMDataModel.getLogin(); + if (!ld.canSwipeMonitors) return; + ZMDataModel.zmDebug("ModalCtrl:Left swipe detected, moving to " + ZMDataModel.getNextMonitor(m, d)); $scope.monitorId = ZMDataModel.getNextMonitor(m, d); @@ -315,11 +331,24 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco noBackdrop: true, duration: zm.loadingTimeout, }); + + }; - // not being used anymore - using a dedicated menu instead + $scope.onTapRight = function (m,d) + { + ZMDataModel.zmDebug("ModalCtrl:Right tap detected, moving to " + ZMDataModel.getNextMonitor(m, d)); + $scope.monitorId = ZMDataModel.getNextMonitor(m, d); + + $ionicLoading.show({ + template: "please wait...", + noBackdrop: true, + duration: zm.loadingTimeout, + }); + }; $scope.onSwipeRight = function (m, d) { + if (!ld.canSwipeMonitors) return; ZMDataModel.zmDebug("ModalCtrl:Right swipe detected, moving to " + ZMDataModel.getNextMonitor(m, d)); $scope.monitorId = ZMDataModel.getNextMonitor(m, d); |
