mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Archive project action button
This commit is contained in:
parent
a2dff4bfbb
commit
ffc06f2a3b
2 changed files with 10 additions and 4 deletions
|
@ -65,5 +65,6 @@ if settings.overleaf
|
|||
tooltip=translate('archive'),
|
||||
tooltip-placement="top",
|
||||
tooltip-append-to-body="true",
|
||||
ng-click="archive($event)"
|
||||
)
|
||||
i.icon.fa.fa-inbox
|
|
@ -350,14 +350,15 @@ define [
|
|||
$scope.archiveOrLeaveSelectedProjects()
|
||||
|
||||
$scope.archiveOrLeaveSelectedProjects = () ->
|
||||
selected_projects = $scope.getSelectedProjects()
|
||||
selected_project_ids = $scope.getSelectedProjectIds()
|
||||
$scope.archiveOrLeaveProjects($scope.getSelectedProjects())
|
||||
|
||||
$scope.archiveOrLeaveProjects = (projects) ->
|
||||
projectIds = projects.map (p) -> p.id
|
||||
# Remove project from any tags
|
||||
for tag in $scope.tags
|
||||
$scope._removeProjectIdsFromTagArray(tag, selected_project_ids)
|
||||
$scope._removeProjectIdsFromTagArray(tag, projectIds)
|
||||
|
||||
for project in selected_projects
|
||||
for project in projects
|
||||
project.tags = []
|
||||
if project.accessLevel == "owner"
|
||||
project.archived = true
|
||||
|
@ -490,3 +491,7 @@ define [
|
|||
$scope.$watch "project.selected", (value) ->
|
||||
if value?
|
||||
$scope.updateSelectedProjects()
|
||||
|
||||
$scope.archive = (e) ->
|
||||
e.stopPropagation()
|
||||
$scope.archiveOrLeaveProjects([$scope.project])
|
||||
|
|
Loading…
Reference in a new issue