Former-commit-id: 997f42a531c1a8fd4dac340129cea645f7c30fb8
This commit is contained in:
Henrique Dias
2016-12-30 16:22:26 +00:00
parent 7d9fb5995a
commit 103457f4e3
8 changed files with 260 additions and 81 deletions

View File

@@ -41,13 +41,12 @@ var renameEvent = function(event) {
let keyDownEvent = (event) => {
if (event.keyCode == 13) {
let newName = span.innerHTML,
newLink = removeLastDirectoryPartOf(toWebDavURL(link)) + newName,
newLink = removeLastDirectoryPartOf(toWebDavURL(link)) + "/" + newName,
html = document.getElementById('rename').changeToLoading(),
request = new XMLHttpRequest();
request.open('MOVE', toWebDavURL(link));
request.setRequestHeader('Destination', newLink);
request.setRequestHeader('Content-type', 'text/plain; charset=utf-8');
request.send();
request.onreadystatechange = function() {
// TODO: redirect if it's moved to another folder