-loadingData - in progress

This commit is contained in:
Matan Bar Yosef 2015-08-01 18:18:21 +03:00
parent 7e3eeb104c
commit 9bede4b399
4 changed files with 7 additions and 8 deletions

View file

@ -8,6 +8,7 @@ angular.module('SeHub')
$scope.isCreateProjectClicked = false; $scope.isCreateProjectClicked = false;
$scope.submitNewCourseClicked = false; $scope.submitNewCourseClicked = false;
$scope.loadingData = true; $scope.loadingData = true;
$scope.creatingProject = false;
$scope.isInCourse = false; $scope.isInCourse = false;
var startDate = null; var startDate = null;
var endDate = null; var endDate = null;
@ -71,7 +72,6 @@ angular.module('SeHub')
} }
$scope.createProjectClicked = function() { $scope.createProjectClicked = function() {
// console.log("project created! is it ?!???! " + classId);
$scope.isCreateProjectClicked = !$scope.isCreateProjectClicked; $scope.isCreateProjectClicked = !$scope.isCreateProjectClicked;
if($scope.isCreateProjectClicked) if($scope.isCreateProjectClicked)
$scope.createSctionStatus = "fa fa-angle-up"; $scope.createSctionStatus = "fa fa-angle-up";
@ -80,10 +80,8 @@ angular.module('SeHub')
} }
$scope.submitNewProject = function() { $scope.submitNewProject = function() {
loadingData = true; $scope.creatingProject = true;
// debugger;
var intClassId = parseInt(classId); var intClassId = parseInt(classId);
// console.log($scope);
var jsonNewProj = { var jsonNewProj = {
'projectName': $scope.project.projectName, 'projectName': $scope.project.projectName,
'courseId': intClassId, 'courseId': intClassId,

View file

@ -23,7 +23,8 @@ angular.module('SeHub')
.ariaLabel('Join project alert dialog').ok('Aight').targetEvent(ev)); .ariaLabel('Join project alert dialog').ok('Aight').targetEvent(ev));
}).error(function(err) }).error(function(err)
{ {
console.log("Error: " + err.message); $mdDialog.show($mdDialog.alert().title('Join Project').content(err.message)
.ariaLabel('Join project alert dialog').ok('Try Again').targetEvent(ev));
}); });
} }

View file

@ -71,8 +71,8 @@
</md-input-container> </md-input-container>
</div> </div>
<div layout-padding layout-margin> <div layout-padding layout-margin>
<md-button ng-click="submitNewProject()" ng class="md-raised md-primary">Submit Project</md-button> <md-button ng-disabled="creatingProject" ng-click="submitNewProject()" class="md-raised md-primary">Submit Project</md-button>
<div layout-paddig layout-margin class="loader" ng-if="loadingData"> <div layout-padding layout-margin class="loader" ng-if="creatingProject">
<md-progress-circular md-mode="indeterminate"></md-progress-circular> <md-progress-circular md-mode="indeterminate"></md-progress-circular>
</div> </div>
</div> </div>

View file

@ -18,7 +18,7 @@
<div layout = "row" flex = "45"> <div layout = "row" flex = "45">
<!-- <div ng-if = "isMasterOrLecturer"> --> <!-- <div ng-if = "isMasterOrLecturer"> -->
<md-card layout = "row"> <md-card layout = "row">
<div ng-if="isMember" layout-padding> <div ng-if="!isMember" layout-padding>
<md-button ng-click="joinProject()" ng class = "md-raised md-primary"> <md-button ng-click="joinProject()" ng class = "md-raised md-primary">
<i class="fa fa-user-plus"></i> <i class="fa fa-user-plus"></i>
</md-button> </md-button>