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 if settings.overleaf
.hidden-xs.col-sm-3.col-md-2.action-btn-row .hidden-xs.col-sm-3.col-md-2.action-btn-row
button.btn.btn-link.action-btn( div(
tooltip=translate('copy'), ng-if="!project.isTableActionInflight"
tooltip-placement="top",
tooltip-append-to-body="true",
ng-click="clone($event)"
) )
i.icon.fa.fa-files-o button.btn.btn-link.action-btn(
button.btn.btn-link.action-btn( tooltip=translate('copy'),
tooltip=translate('download'), tooltip-placement="top",
tooltip-placement="top", tooltip-append-to-body="true",
tooltip-append-to-body="true", ng-click="clone($event)"
ng-click="download($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 i.fa.fa-spinner.fa-spin
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

View file

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