diff options
| author | EoleDev <root@serverpc.home> | 2016-03-09 16:17:33 +0100 |
|---|---|---|
| committer | EoleDev <root@serverpc.home> | 2016-03-09 16:17:33 +0100 |
| commit | 2b8decb81faeb7928bcbfda84c6f33a003f707fd (patch) | |
| tree | 0e491d7ae2bf91347b1cf50d2c475625d8f659b4 /client/js/controllers | |
| parent | b7ebe1272c1127df290535af2430622b28160bb0 (diff) | |
| parent | 03ef74d0cfe675a6e18a91f039182ca1b248d8f5 (diff) | |
Maj Library
Diffstat (limited to 'client/js/controllers')
| -rw-r--r-- | client/js/controllers/home/home.js | 10 | ||||
| -rw-r--r-- | client/js/controllers/image/image.js | 21 |
2 files changed, 29 insertions, 2 deletions
diff --git a/client/js/controllers/home/home.js b/client/js/controllers/home/home.js index f84f625..4402e62 100644 --- a/client/js/controllers/home/home.js +++ b/client/js/controllers/home/home.js @@ -3,7 +3,7 @@ * * @param {$scope} $scope The $scope service from angular */ -mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','Identity', function ($scope, Compute, $rootScope, Loading, Identity) +mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','Identity', 'Image', function ($scope, Compute, $rootScope, Loading, Identity, Image) { var callMeAfterPullData=function(data){ @@ -16,8 +16,14 @@ mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','I Loading.start(); Compute.pullData(callMeAfterPullData); } + else{ + if(Identity.isAlreadyLogin()){ + callMeAfterPullData(); + } + } - + + Image.getImages(function(){}); $scope.raiseShowMachineDetailsEvent=function(id){ diff --git a/client/js/controllers/image/image.js b/client/js/controllers/image/image.js new file mode 100644 index 0000000..e298fcc --- /dev/null +++ b/client/js/controllers/image/image.js @@ -0,0 +1,21 @@ +/** + * The image controller + * + * @param {$scope} $scope The $scope service from angular + */ +mainApp.controller('imageCtrl', ['$scope', 'Image', 'Loading', function ($scope, Image, Loading) +{ + var callbackTest=function(){ + $scope.images=Image.getData().images; + Loading.stop(); + }; + + if(Image.getData().images==null){ + Loading.start(); + Image.getImages(callbackTest); + } + else{ + callbackTest(); + } + +}]); |
