mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Actually remove project from tag, inline.
This commit is contained in:
parent
2708fdf159
commit
208f021bd0
2 changed files with 18 additions and 0 deletions
|
@ -161,6 +161,7 @@
|
|||
) {{tag.name}}
|
||||
a.label.label-default.tag-label-remove(
|
||||
href
|
||||
ng-click="removeProjectFromTag(project, tag)"
|
||||
) ×
|
||||
|
||||
.col-xs-2
|
||||
|
|
|
@ -201,6 +201,23 @@ define [
|
|||
# the projects from view
|
||||
$scope.updateVisibleProjects()
|
||||
|
||||
$scope.removeProjectFromTag = (project, tag) ->
|
||||
tag.showWhenEmpty = true
|
||||
|
||||
project.tags ||= []
|
||||
index = project.tags.indexOf tag
|
||||
|
||||
if index > -1
|
||||
$scope._removeProjectIdsFromTagArray(tag, [ project.id ])
|
||||
project.tags.splice(index, 1)
|
||||
queuedHttp({
|
||||
method: "DELETE"
|
||||
url: "/tag/#{tag._id}/project/#{project.id}"
|
||||
headers:
|
||||
"X-CSRF-Token": window.csrfToken
|
||||
})
|
||||
$scope.updateVisibleProjects()
|
||||
|
||||
$scope.addSelectedProjectsToTag = (tag) ->
|
||||
selected_projects = $scope.getSelectedProjects()
|
||||
event_tracking.send 'project-list-page-interaction', 'project action', 'addSelectedProjectsToTag'
|
||||
|
|
Loading…
Reference in a new issue