summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
authorPliablePixels <pliablepixels@gmail.com>2015-08-07 20:45:26 -0400
committerPliablePixels <pliablepixels@gmail.com>2015-08-07 20:45:26 -0400
commitc2ec08ec9fdfa30e5da278780e1cfa1c6d067f25 (patch)
tree4c90be2711c1724bad0418f7dca0a576732518ad /www/js
parentc854d6c9189298487cd698934f96be28b1bc9bad (diff)
Fixed a bug in doLogin --> q.defer was returning success before it was successfull as it was out of doLogi
Diffstat (limited to 'www/js')
-rw-r--r--www/js/DataModel.js3
-rw-r--r--www/js/LoginCtrl.js1
-rw-r--r--www/js/PortalLoginCtrl.js1
-rw-r--r--www/js/app.js8
4 files changed, 9 insertions, 4 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js
index a79a6cd0..0d9d6ca8 100644
--- a/www/js/DataModel.js
+++ b/www/js/DataModel.js
@@ -285,6 +285,9 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion
getMonitors: function (forceReload) {
console.log("** Inside ZMData getMonitors with forceReload=" + forceReload);
+
+
+
$ionicLoading.show({
template: 'Loading Monitors...',
animation: 'fade-in',
diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js
index 3b5b368b..b3c052d5 100644
--- a/www/js/LoginCtrl.js
+++ b/www/js/LoginCtrl.js
@@ -206,6 +206,7 @@ function addhttp(url) {
{
console.log ("THE DATA WAS " + data);
+ console.log ("SHOWING POPUP ");
$ionicPopup.alert({
title: 'Settings Saved',
template: 'Please explore the menu and enjoy zmNinja!'
diff --git a/www/js/PortalLoginCtrl.js b/www/js/PortalLoginCtrl.js
index 65f92b48..ae75d197 100644
--- a/www/js/PortalLoginCtrl.js
+++ b/www/js/PortalLoginCtrl.js
@@ -21,7 +21,6 @@ console.log ("***** INSIDE LOGIN CONTROLLER");
zmAutoLogin.doLogin("Logging into ZoneMinder...")
.then (function(data)
{
-
ZMDataModel.getKeyConfigParams(1);
$state.go('montage');
});
diff --git a/www/js/app.js b/www/js/app.js
index 026da708..9a15b9f4 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -229,9 +229,10 @@ angular.module('zmApp', [
.factory('zmAutoLogin', function($interval, ZMDataModel, $http,zm, $browser,$timeout,$q, $rootScope, $ionicLoading) {
var zmAutoLoginHandle;
- var d = $q.defer();
+
function doLogin(str)
{
+ var d = $q.defer();
/* if ($rootScope.loggedIntoZm == 1)
{
d.resolve("Already logged in");
@@ -283,10 +284,11 @@ angular.module('zmApp', [
$rootScope.loggedIntoZm = 1;
console.log ("**** ZM Login OK");
ZMDataModel.zmLog("zmAutologin successfully logged into Zoneminder");
- //$cookies.myFavorite = 'oatmeal';
+
//$timeout( function() {console.log ("***** ALL COOKIES:" + JSON.stringify( $browser.cookies()));},1000);
- console.log ("***** ALL HEADERS:" + headers('cookie'));
+
d.resolve("Login Success");
+ console.log ("THIS IS WHERE I RETURN LOGIN SUCCESS DUDE");
return (d.promise);
})