summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--www/js/EventCtrl.js53
-rw-r--r--www/templates/events.html11
2 files changed, 49 insertions, 15 deletions
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js
index a5ddc44d..2fd76080 100644
--- a/www/js/EventCtrl.js
+++ b/www/js/EventCtrl.js
@@ -88,6 +88,9 @@ angular.module('zmApp.controllers')
$scope.$on('$ionicView.afterEnter', function()
{
//console.log ("********* AFTER ENTER");
+ //
+ $ionicListDelegate.canSwipeItems(true);
+ NVRDataModel.debug ("enabling options swipe");
// see if we come from monitors, if so, don't filter events
if ($ionicHistory.backTitle() == 'Monitors')
@@ -950,14 +953,7 @@ angular.module('zmApp.controllers')
};
- $scope.alarmSwipe = function(e)
- {
-
- //alert ("HERE");
- console.log ("HERE");
- e.stopPropagation();
- e.preventDefault();
- };
+
$scope.toggleMotionOutline = function()
{
@@ -2048,6 +2044,21 @@ angular.module('zmApp.controllers')
$ionicSlideBoxDelegate.$getByHandle("eventSlideBox").enableSlide(false);
};
+ $scope.checkSwipe = function (ndx)
+ {
+ if ($scope.events[ndx].Event.ShowScrub)
+ {
+ $ionicListDelegate.canSwipeItems(false);
+ NVRDataModel.debug ("disabling options swipe");
+ }
+ else
+ {
+ $ionicListDelegate.canSwipeItems(true);
+ NVRDataModel.debug ("enabling options swipe");
+ }
+
+ }
+
//-------------------------------------------------------------------------
// This function is called when a user enables or disables
// scrub view for an event.
@@ -2067,8 +2078,7 @@ angular.module('zmApp.controllers')
function toggleGroup(event, ndx, frames, groupType)
{
- $ionicListDelegate.canSwipeItems(true);
- NVRDataModel.debug ("enabling options swipe");
+
// If we are here and there is a record of a previous scroll
// then we need to scroll back to hide that view
@@ -2088,6 +2098,24 @@ angular.module('zmApp.controllers')
}
event.Event.ShowScrub = !event.Event.ShowScrub;
+
+ if (event.Event.ShowScrub == false)
+ {
+ $ionicListDelegate.canSwipeItems(true);
+ NVRDataModel.debug ("enabling options swipe due to toggle");
+ }
+
+ else
+ {
+ $ionicListDelegate.canSwipeItems(false);
+ $ionicListDelegate.closeOptionButtons();
+ NVRDataModel.debug ("disabling options swipe due to toggle");
+
+ }
+
+
+
+
//console.log ("SCRUBBING IS "+event.Event.ShowScrub);
// $ionicScrollDelegate.resize();
@@ -2095,6 +2123,7 @@ angular.module('zmApp.controllers')
if (event.Event.ShowScrub == true) // turn on display now
{
+
if (groupType == 'alarms')
{
@@ -2360,6 +2389,10 @@ angular.module('zmApp.controllers')
else
{
// $ionicScrollDelegate.freezeScroll(false);
+ //
+ // $ionicListDelegate.canSwipeItems(true);
+ // NVRDataModel.debug ("enabling options swipe");
+
$ionicSideMenuDelegate.canDragContent(true);
event.Event.height = eventsListDetailsHeight;
$ionicScrollDelegate.resize();
diff --git a/www/templates/events.html b/www/templates/events.html
index 67971f7a..3c48f576 100644
--- a/www/templates/events.html
+++ b/www/templates/events.html
@@ -25,7 +25,7 @@
<!-- lets make sure the events list is not empty as collection repeat needs height -->
<div ng-if="!eventsBeingLoaded">
<ion-list show-delete="eventList.showDelete">
- <ion-item collection-repeat="event in events| filter:search.text" item-height="event.Event.height" id="item-{{$index}}">
+ <ion-item collection-repeat="event in events| filter:search.text" item-height="event.Event.height" id="item-{{$index}}" on-swipe-left="checkSwipe($index);">
<span style="float:left;margin-top:-18px;background-color:#96281B;color:#fff;font-size:11px;opacity:0.7;border-radius: 0px 0px 5px 5px;">&nbsp;&nbsp;&nbsp;<i class="ion-calendar"></i>&nbsp;&nbsp;{{prettifyTime(event.Event.StartTime)}}&nbsp;{{tzAbbr}}&nbsp;</span>&nbsp;&nbsp;
<span style="float:left;margin-top:-18px;background-color:#fff;color:#888;font-size:11px;opacity:1;">&nbsp;&nbsp;<i class="ion-arrow-right-b"></i>&nbsp;{{event.Event.humanizeTime}} <span ng-if="!event.Event.EndTime">(<span translate="kRecordingProgress"></span>)</span>
</span>
@@ -128,7 +128,7 @@
</p>
- <ion-scroll direction="x" overflow-scroll="false" on-swipe-left="alarmSwipe($event)">
+ <ion-scroll direction="x" overflow-scroll="false" >
<span ng-repeat="alarm in alarm_images | selectFrames: typeOfFrames">
<figure class = "animated slideInLeft" style="display:inline-block">
@@ -196,10 +196,11 @@
<ion-delete-button class="ion-minus-circled" ng-click="deleteEvent(event.Event.Id, $index)">
</ion-delete-button>
- <ion-option-button ng-if="event.Event.Archived == 1 && !event.Event.ShowScrub" class="button-balanced" ng-click= "archiveUnarchiveEvent($index,event.Event.Id)">{{'kUnflag' | translate}}</ion-option-button>
+
+ <ion-option-button ng-if="event.Event.Archived == 1" class="button-balanced" ng-click= "archiveUnarchiveEvent($index,event.Event.Id)">{{'kUnflag' | translate}}</ion-option-button>
- <ion-option-button ng-if="event.Event.Archived == 0 && !event.Event.ShowScrub" class="button-assertive" ng-click="archiveUnarchiveEvent($index, event.Event.Id)" >{{'kFlag' | translate}}</ion-option-button>
-
+ <ion-option-button ng-if="event.Event.Archived == 0" class="button-assertive" ng-click="archiveUnarchiveEvent($index, event.Event.Id)" >{{'kFlag' | translate}}</ion-option-button>
+
<!-- hack to make sure swipe left displays well
if there is no content and our list height is set