Clean some things

This commit is contained in:
manzerbredes 2016-03-02 20:46:24 +01:00
parent fa5a48bc3a
commit e2be86814e
4 changed files with 21 additions and 18 deletions

View file

@ -6,23 +6,25 @@
mainApp.controller('machineDetailsCtrl', [ '$scope', 'Compute', '$rootScope', '$timeout', function ($scope, Compute, $rootScope, $timeout)
{
// 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;