summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEole <EoleDev@outlook.fr>2016-05-04 20:07:11 +0200
committerEole <EoleDev@outlook.fr>2016-05-04 20:07:11 +0200
commitb2c76ddf0a27521a1f11a52af968ac3df1c063f7 (patch)
tree8f5a27998ffe56610ff2a1b9cb701f8852423eb2
parentd24d569f1c164b9eba818e34843bd8e3de287f3d (diff)
Error Correction
-rwxr-xr-xclient/js/controllers/home/home.js49
1 files changed, 1 insertions, 48 deletions
diff --git a/client/js/controllers/home/home.js b/client/js/controllers/home/home.js
index f7750e9..1b4acf8 100755
--- a/client/js/controllers/home/home.js
+++ b/client/js/controllers/home/home.js
@@ -5,51 +5,6 @@
*/
mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','Identity', 'Image', function ($scope, Compute, $rootScope, Loading, Identity, Image)
{
- // Function to call after pull all data about machines
- var callMeAfterPullData=function(data){
- //$scope.machines=Compute.getData().machines;
- Loading.stop();
- displayMachine();
- };
-
- var tryToRetrieveData = function () {
- // If no data retrieve about machine and user is logged
- if (Compute.getData().machines == null && Identity.isAlreadyLogin()) {
- Loading.start(); // Show loading gif
- Compute.pullData(callMeAfterPullData); // Retrieve data and call the callback
- } else {
- // Else if user is logged and data is already retrieve
- // simply display data
- if (Identity.isAlreadyLogin()) {
- callMeAfterPullData(); // Display data
- }
- }
- };
-
- // On user login
- $scope.$on('loginEvent', function () {
- tryToRetrieveData();
- });
-
- // Function to call from view to display the details of a machine
- $scope.raiseShowMachineDetailsEvent = function (id) {
-
- // Stop loading gif and display overlay
- var callback = function () {
- Loading.stop();
- var data = Compute.getData();
-
- $rootScope.$broadcast("showMachineDetailsEvent", data.machines[id], data.axioms);
-
- };
- Loading.start(); // Show loading gif
- Compute.pullMachines(callback); // Retrieve machine info and display overlay
- };
-
- // Try to retrieve data for the first time
- tryToRetrieveData();
-
-
var displayMachine = function(){
var machineNames = [];
var i = 0;
@@ -203,9 +158,7 @@ mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','I
var width = 130;
var height = 80;
var data = Compute.getData();
-
- //console.log(data.machines[vm[1]]);
-
+
if(data.machines[vm[1]].status == "ACTIVE"){
return new joint.shapes.org.Member({
id: vm[1],