diff options
Diffstat (limited to 'client/js/controllers/home/machineDetails.js')
| -rw-r--r-- | client/js/controllers/home/machineDetails.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/client/js/controllers/home/machineDetails.js b/client/js/controllers/home/machineDetails.js index 24fac42..371310b 100644 --- a/client/js/controllers/home/machineDetails.js +++ b/client/js/controllers/home/machineDetails.js @@ -3,29 +3,32 @@ * * @param {$scope} $scope The $scope service from angular */ -mainApp.controller('machineDetailsCtrl', [ '$scope', 'Compute', '$rootScope', '$timeout', function ($scope, Compute, $rootScope, $timeout) +mainApp.controller('machineDetailsCtrl', [ '$scope', 'Compute', '$rootScope', '$timeout', 'Identity', function ($scope, Compute, $rootScope, $timeout, Identity) { + + // Init scope $scope.machine={}; - $("#waitingForToggleMachine").hide(); + $scope.machineIsStarting=false; // For loading icon + $scope.$on('showMachineDetailsEvent', function(eventName ,machine, axioms){ $scope.machine=machine; $scope.axioms=axioms; - console.log(machine); $('#machineDetailsModal').modal({backdrop: false, keyboard: true}); }); $scope.toggleMachineState=function(){ - $("#waitingForToggleMachine").show(); + // Display gif + $scope.machineIsStarting=true; // Fake timeout $timeout(function(){ - $("#waitingForToggleMachine").hide(); + $scope.machineIsStarting=false; }, 3000); $timeout(function(){ - $scope.machine.online=!$scope.machine.online; + $scope.machine.online=!$scope.machine.online; }, 3000); @@ -35,7 +38,7 @@ mainApp.controller('machineDetailsCtrl', [ '$scope', 'Compute', '$rootScope', '$ $scope.applyModifications=function(){ //Todo } - + }]); |
