summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js')
-rw-r--r--www/js/MontageCtrl.js19
-rw-r--r--www/js/PortalLoginCtrl.js119
2 files changed, 79 insertions, 59 deletions
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js
index 364daf08..8a8209df 100644
--- a/www/js/MontageCtrl.js
+++ b/www/js/MontageCtrl.js
@@ -273,18 +273,25 @@ angular.module('zmApp.controllers')
function itemDragged(item)
{
NVRDataModel.debug("drag complete");
+ $timeout (function(){pckry.shiftLayout();},20);
+
+ pckry.once ('layoutComplete', function() {
+
+ var positions = pckry.getShiftPositions('data-item-id');
+ //console.log ("POSITIONS MAP " + JSON.stringify(positions));
+ var ld = NVRDataModel.getLogin();
+ ld.packeryPositions = JSON.stringify(positions);
+ //console.log ("Saving " + ld.packeryPositions);
+ NVRDataModel.setLogin(ld);
+ NVRDataModel.debug("saved new positions");
+ });
//pckry.getItemElements().forEach(function (itemElem) {
//console.log (itemElem.attributes['data-item-id'].value+" size "+itemElem.attributes['data-item-size'].value );
// });
- var positions = pckry.getShiftPositions('data-item-id');
- //console.log ("POSITIONS MAP " + JSON.stringify(positions));
- var ld = NVRDataModel.getLogin();
- ld.packeryPositions = JSON.stringify(positions);
- //console.log ("Saving " + ld.packeryPositions);
- NVRDataModel.setLogin(ld);
+
}
}
diff --git a/www/js/PortalLoginCtrl.js b/www/js/PortalLoginCtrl.js
index ff2f61d0..95eb72d4 100644
--- a/www/js/PortalLoginCtrl.js
+++ b/www/js/PortalLoginCtrl.js
@@ -214,6 +214,58 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic
return (d.promise);
}
+ function evaluateTappedNotification()
+ {
+ if ($rootScope.tappedNotification)
+ {
+
+ var ld = NVRDataModel.getLogin();
+ NVRDataModel.log("Came via push tap. onTapScreen=" + ld.onTapScreen);
+ //console.log ("***** NOTIFICATION TAPPED ");
+ $rootScope.tappedNotification = 0;
+ $ionicHistory.nextViewOptions(
+ {
+ disableBack: true
+ });
+
+ if (ld.onTapScreen == $translate.instant('kTapMontage'))
+ {
+ NVRDataModel.debug("Going to montage");
+ $state.go("montage",
+ {},
+ {
+ reload: true
+ });
+
+ return;
+ }
+ else if (ld.onTapScreen == $translate.instant('kTapEvents'))
+ {
+ NVRDataModel.debug("Going to events");
+ $state.go("events",
+ {
+ "id": 0,
+ "playEvent": false
+ },
+ {
+ reload: true
+ });
+ return;
+ }
+ else // we go to live
+ {
+ NVRDataModel.debug("Going to live view ");
+ $state.go("monitors",
+ {},
+ {
+ reload: true
+ });
+ return;
+ }
+ }
+
+ }
+
function unlock(idVerified)
{
/*
@@ -282,14 +334,21 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic
// coming here means continue
// console.log (">>>>>>>>>>>>>>>>>>>>>>>>>NEVER");
EventServer.refresh();
+ if ($rootScope.tappedNotification != 1)
+ {
+ console.log ("NOTIFICATION TAPPED INSIDE CHECK IS "+$rootScope.tappedNotification);
+ var statetoGo = $rootScope.lastState ? $rootScope.lastState : 'montage';
+ NVRDataModel.debug("logging state transition");
+ NVRDataModel.debug("Transitioning state to: " +
+ statetoGo + " with param " + JSON.stringify($rootScope.lastStateParam));
- var statetoGo = $rootScope.lastState ? $rootScope.lastState : 'montage';
- NVRDataModel.debug("logging state transition");
- NVRDataModel.debug("Transitioning state to: " +
- statetoGo + " with param " + JSON.stringify($rootScope.lastStateParam));
+ $state.go(statetoGo, $rootScope.lastStateParam);
+ return;
- $state.go(statetoGo, $rootScope.lastStateParam);
- return;
+ }
+ else
+ evaluateTappedNotification();
+
},
function(error)
@@ -319,53 +378,7 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic
});
- if ($rootScope.tappedNotification)
- {
-
- var ld = NVRDataModel.getLogin();
- NVRDataModel.log("Came via push tap. onTapScreen=" + ld.onTapScreen);
- //console.log ("***** NOTIFICATION TAPPED ");
- $rootScope.tappedNotification = 0;
- $ionicHistory.nextViewOptions(
- {
- disableBack: true
- });
-
- if (ld.onTapScreen == $translate.instant('kTapMontage'))
- {
- NVRDataModel.debug("Going to montage");
- $state.go("montage",
- {},
- {
- reload: true
- });
-
- return;
- }
- else if (ld.onTapScreen == $translate.instant('kTapEvents'))
- {
- NVRDataModel.debug("Going to events");
- $state.go("events",
- {
- "id": 0,
- "playEvent": false
- },
- {
- reload: true
- });
- return;
- }
- else // we go to live
- {
- NVRDataModel.debug("Going to live view ");
- $state.go("monitors",
- {},
- {
- reload: true
- });
- return;
- }
- }
+
},
// coming here means auth error