Add loading spinner when cloning a project.

This commit is contained in:
Paulo Reis 2018-08-31 16:14:20 +01:00
parent 8ad9db3f02
commit f88a3815c6
2 changed files with 46 additions and 36 deletions

View file

@ -49,41 +49,48 @@ div(class=lastUpdatedClasses)
if settings.overleaf
.hidden-xs.col-sm-3.col-md-2.action-btn-row
button.btn.btn-link.action-btn(
tooltip=translate('copy'),
tooltip-placement="top",
tooltip-append-to-body="true",
ng-click="clone($event)"
div(
ng-if="!project.isTableActionInflight"
)
i.icon.fa.fa-files-o
button.btn.btn-link.action-btn(
tooltip=translate('download'),
tooltip-placement="top",
tooltip-append-to-body="true",
ng-click="download($event)"
button.btn.btn-link.action-btn(
tooltip=translate('copy'),
tooltip-placement="top",
tooltip-append-to-body="true",
ng-click="clone($event)"
)
i.icon.fa.fa-files-o
button.btn.btn-link.action-btn(
tooltip=translate('download'),
tooltip-placement="top",
tooltip-append-to-body="true",
ng-click="download($event)"
)
i.icon.fa.fa-cloud-download
button.btn.btn-link.action-btn(
ng-if="!project.archived && isOwner()"
tooltip=translate('archive'),
tooltip-placement="top",
tooltip-append-to-body="true",
ng-click="archiveOrLeave($event)"
)
i.icon.fa.fa-inbox
button.btn.btn-link.action-btn(
ng-if="!project.archived && !isOwner()"
tooltip=translate('leave'),
tooltip-placement="top",
tooltip-append-to-body="true",
ng-click="archiveOrLeave($event)"
)
i.icon.fa.fa-sign-out
button.btn.btn-link.action-btn(
ng-if="project.archived"
tooltip=translate('unarchive'),
tooltip-placement="top",
tooltip-append-to-body="true",
ng-click="restore($event)"
)
i.icon.fa.fa-reply
div(
ng-if="project.isTableActionInflight"
)
i.icon.fa.fa-cloud-download
button.btn.btn-link.action-btn(
ng-if="!project.archived && isOwner()"
tooltip=translate('archive'),
tooltip-placement="top",
tooltip-append-to-body="true",
ng-click="archiveOrLeave($event)"
)
i.icon.fa.fa-inbox
button.btn.btn-link.action-btn(
ng-if="!project.archived && !isOwner()"
tooltip=translate('leave'),
tooltip-placement="top",
tooltip-append-to-body="true",
ng-click="archiveOrLeave($event)"
)
i.icon.fa.fa-sign-out
button.btn.btn-link.action-btn(
ng-if="project.archived"
tooltip=translate('unarchive'),
tooltip-placement="top",
tooltip-append-to-body="true",
ng-click="restore($event)"
)
i.icon.fa.fa-reply
i.fa.fa-spinner.fa-spin

View file

@ -502,7 +502,10 @@ define [
$scope.clone = (e) ->
e.stopPropagation()
$scope.project.isTableActionInflight = true
$scope.cloneProject($scope.project, "#{$scope.project.name} (Copy)")
.then () -> $scope.project.isTableActionInflight = false
.catch () -> $scope.project.isTableActionInflight = false
$scope.download = (e) ->
e.stopPropagation()