summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArjun Roychowdhury <pliablepixels@gmail.com>2015-11-05 13:25:22 -0500
committerArjun Roychowdhury <pliablepixels@gmail.com>2015-11-05 13:25:22 -0500
commit2b51690e5a5dec4d1925ca3090ad75e00991443b (patch)
treed96c471061487a3da57c4ed72cb2b30dd633c0a2
parentd14b5640b5df95397f12f7b0d09e20631102aa63 (diff)
#66 - if you are zoomed in, swipe to next monitor/event will be disabled
-rw-r--r--www/js/EventCtrl.js8
-rw-r--r--www/js/ModalCtrl.js24
-rw-r--r--www/templates/events-modal.html2
-rw-r--r--www/templates/monitors-modal.html2
4 files changed, 34 insertions, 2 deletions
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js
index a4da30dc..42c96118 100644
--- a/www/js/EventCtrl.js
+++ b/www/js/EventCtrl.js
@@ -1251,6 +1251,14 @@ angular.module('zmApp.controllers')
{
var ld = ZMDataModel.getLogin();
if (!ld.canSwipeMonitors) return;
+
+ if
+ ($ionicScrollDelegate.$getByHandle("imgscroll").getScrollPosition().zoom!=1)
+ {
+ console.log("Image is zoomed in - not honoring swipe");
+ return;
+ }
+
jumpToEvent(eid,dirn);
};
diff --git a/www/js/ModalCtrl.js b/www/js/ModalCtrl.js
index 3a130363..dea908d8 100644
--- a/www/js/ModalCtrl.js
+++ b/www/js/ModalCtrl.js
@@ -347,10 +347,26 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco
});
};
+
+ $scope.getZoomLevel = function()
+ {
+ console.log ("ON RELEASE");
+ var zl = $ionicScrollDelegate.$getByHandle("imgscroll").getScrollPosition();
+ console.log (JSON.stringify(zl));
+ };
+
$scope.onSwipeLeft = function (m, d) {
var ld = ZMDataModel.getLogin();
if (!ld.canSwipeMonitors) return;
+ if
+ ($ionicScrollDelegate.$getByHandle("imgscroll").getScrollPosition().zoom!=1)
+ {
+ console.log("Image is zoomed in - not honoring swipe");
+ return;
+ }
+
+
var curstate = $ionicHistory.currentStateName();
var found=0;
var mid;
@@ -439,6 +455,14 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco
};
$scope.onSwipeRight = function (m, d) {
if (!ld.canSwipeMonitors) return;
+
+ if
+ ($ionicScrollDelegate.$getByHandle("imgscroll").getScrollPosition().zoom!=1)
+ {
+ console.log("Image is zoomed in - not honoring swipe");
+ return;
+ }
+
var found=0;
var mid;
var curstate = $ionicHistory.currentStateName();
diff --git a/www/templates/events-modal.html b/www/templates/events-modal.html
index c3fbffcf..8c2ca549 100644
--- a/www/templates/events-modal.html
+++ b/www/templates/events-modal.html
@@ -3,7 +3,7 @@
<ion-modal-view cache-view="false">
<ion-content style="background-color:#444444" ng-cloak>
- <ion-scroll has-bouncing=false min-zoom=1 zooming="true" direction="xy" style="width: 100%; ">
+ <ion-scroll has-bouncing=false min-zoom=1 zooming="true" direction="xy" style="width: 100%; " delegate-handle="imgscroll">
<div id="full-screen-event" style="height: 100vh;">
diff --git a/www/templates/monitors-modal.html b/www/templates/monitors-modal.html
index 8db208e9..47f67f08 100644
--- a/www/templates/monitors-modal.html
+++ b/www/templates/monitors-modal.html
@@ -6,7 +6,7 @@
<ion-modal-view cache-view="false" style="background-color:#444444" >
<ion-content >
<!-- <div style="background-color:red; color:white"> Modal Rand:{{$root.modalRand}} </div>-->
- <ion-scroll delegate="imgscroll" has-bouncing=false min-zoom=1 zooming="true"
+ <ion-scroll delegate-handle="imgscroll" has-bouncing=false min-zoom=1 zooming="true"
direction="xy" style="width: 100%; ">
<!-- android needs this 100vh - otherwise max- does not work -->