mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-30 20:11:25 +00:00
Add renamingToName override name for instant apparent renames
This commit is contained in:
parent
9721dffbb6
commit
aa6c16593e
2 changed files with 8 additions and 6 deletions
|
@ -110,7 +110,7 @@ script(type='text/ng-template', id='entityListItemTemplate')
|
|||
i.fa.fa-fw(ng-if="entity.type != 'folder'", ng-class="'fa-' + iconTypeFromName(entity.name)")
|
||||
span(
|
||||
ng-hide="entity.renaming"
|
||||
) {{ entity.name }}
|
||||
) {{ entity.renamingToName || entity.name }}
|
||||
span.rename-input
|
||||
input(
|
||||
ng-if="permissions.write",
|
||||
|
@ -198,7 +198,7 @@ script(type='text/ng-template', id='entityListItemTemplate')
|
|||
|
||||
span(
|
||||
ng-hide="entity.renaming"
|
||||
) {{ entity.name }}
|
||||
) {{ entity.renamingToName || entity.name }}
|
||||
span.rename-input
|
||||
input(
|
||||
ng-if="permissions.write",
|
||||
|
|
|
@ -362,13 +362,15 @@ define [
|
|||
parent_folder = @getCurrentFolder()
|
||||
if @existsInThisFolder parent_folder, name
|
||||
return @nameExistsError()
|
||||
# We'll wait for the socket.io notification to actually
|
||||
# do the rename for us.
|
||||
entity.renamingToName = name
|
||||
@ide.$http.post("/project/#{@ide.project_id}/#{entity.type}/#{entity.id}/rename", {
|
||||
name: name,
|
||||
_csrf: window.csrfToken
|
||||
}).then () ->
|
||||
entity.name = name
|
||||
})
|
||||
.then () ->
|
||||
entity.name = name
|
||||
.finally () ->
|
||||
entity.renamingToName = null
|
||||
|
||||
deleteEntity: (entity, callback = (error) ->) ->
|
||||
# We'll wait for the socket.io notification to
|
||||
|
|
Loading…
Reference in a new issue