summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/index.html4
-rw-r--r--client/js/controllers/home/main.js8
-rw-r--r--client/js/services/Loading.js22
-rw-r--r--client/partials/loading.html18
4 files changed, 49 insertions, 3 deletions
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 @@
<div ng-include="'./partials/login.html'"></div>
<!-- Machine Details Overlay -->
<div ng-include="'./partials/home/machineDetails.html'"></div>
+ <div ng-include="'./partials/loading.html'"></div>
- <!-- Nav -->
+ <!-- Nav -->
<div ng-include="'./partials/nav.html'"></div>
</div>
</div>
@@ -79,6 +80,7 @@
<script src="./js/services/Identity.js"></script>
<script src="./js/services/Image.js"></script>
<script src="./js/services/Compute.js"></script>
+ <script src="./js/services/Loading.js"></script>
<!-- Include controller -->
<script src="./js/controllers/login.js"></script>
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 @@
+<div class="modal fade" id="loadingModal" ng-controller="loginCtrl">
+ <div class="modal-dialog">
+ <div class="modal-content"></div>
+ </div>
+ <div class="modal-dialog" style="width:200px;">
+ <div class="modal-content">
+
+ <div class="modal-body" >
+ <div align="center">
+ <img src="images/spin/128x128/Preloader_8.gif" />
+ </div>
+
+
+ </div>
+
+ </div>
+ </div>
+</div>