Blame view
app/partials/main/main.controller.js
2.36 KB
feacde5ff
|
1 2 3 4 5 |
(function() { 'use strict' angular.module('acufuel') |
e33b4556c
|
6 |
.controller('MainController', [ '$scope', '$filter','$rootScope','$state', '$window', '$interval', MainController]); |
feacde5ff
|
7 |
|
e33b4556c
|
8 |
function MainController($scope, $filter, $rootScope,$state, $window, $interval) { |
dd378d69f
|
9 |
|
e196b9b74
|
10 |
$scope.currentUserName = JSON.parse(localStorage.getItem('currentUserName')); |
429786996
|
11 |
|
e33b4556c
|
12 |
|
3c77051a2
|
13 14 15 |
$scope.testFunction = function(){ $scope.currentUserName = JSON.parse(localStorage.getItem('currentUserName')); } |
e33b4556c
|
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
/** Automatic logout session **/ var resetTime; /*function warning(){ //setTimeout(function(){ $('.warning-message').delay(5000).css('display', 'block'); //}, 5000); }*/ resetTime = setInterval(function(){ // $('.warning-message').delay(5000).css('display', 'block'); //console.log('out'); localStorage.clear(); $state.go('login'); }, 600000); $(document).mousemove(function(event){ clearInterval(resetTime); //$('.warning-message').delay(5000).css('display', 'none'); // warning(); //console.log('restart'); resetTime = setInterval(function(){ //console.log('out'); //warning(); localStorage.clear(); $state.go('login'); }, 600000); }) |
3c77051a2
|
51 |
|
da40330c8
|
52 |
// Flight Tracking page code |
bfb1a2a46
|
53 |
/*$scope.reloadPage = function(){ |
429786996
|
54 55 56 57 58 59 |
console.log("if",$state) console.log("=========state name",$state.current.name); // $state.go('app.flightTracking', {}, {reload: 'app.flightTracking'}) //$state.go($state.current, {}, {reload: true}); if($state.current.name != "app.flightTracking"){ |
bfb1a2a46
|
60 |
$window.location.href = '/#!/flightTracking'; |
429786996
|
61 62 63 64 65 66 67 68 |
setInterval(function(){ console.log("come") $window.location.reload() },10); }else{ console.log("flight tracking state found====="); $window.location.reload(); } |
bfb1a2a46
|
69 70 |
}*/ |
e33b4556c
|
71 |
// Set timeout variables. |
bfb1a2a46
|
72 |
|
feacde5ff
|
73 |
} |
e33b4556c
|
74 75 76 77 |
//var timoutWarning = 840000; // Display warning in 14 Mins. //var timoutNow = 900000; // Timeout in 15 mins. |
da40330c8
|
78 |
|
feacde5ff
|
79 |
})(); |
da40330c8
|
80 |