diff --git a/client/index.html b/client/index.html index 8d81ac3..8ca2b9f 100644 --- a/client/index.html +++ b/client/index.html @@ -28,8 +28,9 @@
+ - + @@ -79,6 +80,7 @@ + diff --git a/client/js/controllers/home/main.js b/client/js/controllers/home/main.js index 9d7ddfc..2e9c00b 100644 --- a/client/js/controllers/home/main.js +++ b/client/js/controllers/home/main.js @@ -3,24 +3,28 @@ * * @param {$scope} $scope The $scope service from angular */ -mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', function ($scope, Compute, $rootScope) +mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading', function ($scope, Compute, $rootScope, Loading) { var callMeAfterPullData=function(data){ $scope.machines=Compute.getData().machines; + Loading.stop(); } - + Loading.start(); Compute.pullData(callMeAfterPullData); $scope.raiseShowMachineDetailsEvent=function(id){ + var callback=function(){ + Loading.stop(); var data=Compute.getData(); $rootScope.$broadcast("showMachineDetailsEvent", data.machines[id], data.axioms); } + Loading.start(); Compute.pullMachines(callback); } diff --git a/client/js/services/Loading.js b/client/js/services/Loading.js new file mode 100644 index 0000000..b12aaa0 --- /dev/null +++ b/client/js/services/Loading.js @@ -0,0 +1,22 @@ + +mainApp.factory('Loading',[ '$http', 'Identity', function($http, Identity){ + + + + + var start=function(){ + $('#loadingModal').modal({backdrop: 'static', keyboard: false}); + }; + + var stop=function(){ + $('#loadingModal').modal('hide'); + } + + + return { + start:start, + stop:stop + }; + + +}]); diff --git a/client/partials/loading.html b/client/partials/loading.html new file mode 100644 index 0000000..c978190 --- /dev/null +++ b/client/partials/loading.html @@ -0,0 +1,18 @@ +