diff --git a/services/web/app/views/project/editor/file-tree.pug b/services/web/app/views/project/editor/file-tree.pug index cfbc9cedaf..fade8e0782 100644 --- a/services/web/app/views/project/editor/file-tree.pug +++ b/services/web/app/views/project/editor/file-tree.pug @@ -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", diff --git a/services/web/public/coffee/ide/file-tree/FileTreeManager.coffee b/services/web/public/coffee/ide/file-tree/FileTreeManager.coffee index 352f28a7bd..9891bd8e74 100644 --- a/services/web/public/coffee/ide/file-tree/FileTreeManager.coffee +++ b/services/web/public/coffee/ide/file-tree/FileTreeManager.coffee @@ -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