Commit bc0d51ed by x

Merge branch 'master' of ssh://giccero.cloud.ik.bme.hu/cloud

parents 1f45bc49 11578d5f
...@@ -280,10 +280,18 @@ $(function() { ...@@ -280,10 +280,18 @@ $(function() {
* Renames the specified file * Renames the specified file
*/ */
self.rename = function(item, e) { self.rename = function(item, e) {
$(e.target).parent().parent().parent().unbind('click'); var oldName=$(e.target).parent().parent().parent().find('.name').html();
$(e.target).parent().unbind('click').click(function(){
$(e.target).parent().parent().parent().find('.name').html(oldName);
$(e.target).parent().click(function(e){
self.rename(item,e);
});
})
//$(e.target).parent().parent().parent().unbind('click');
$(e.target).parent().parent().parent().find('.name').html('<input type="text" value="' + item.originalName + '" />\ $(e.target).parent().parent().parent().find('.name').html('<input type="text" value="' + item.originalName + '" />\
<input type="submit" value="Átnevezés" />'); <input type="submit" value="Átnevezés" />');
$(e.target).parent().parent().parent().find('.name input[type=submit]').click(function() { $(e.target).parent().parent().parent().find('.name input[type=submit]').click(function(e) {
e.preventDefault();
var newName = $(e.target).parent().parent().parent().find('.name input[type=text]').val(); var newName = $(e.target).parent().parent().parent().find('.name input[type=text]').val();
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
...@@ -295,6 +303,7 @@ $(function() { ...@@ -295,6 +303,7 @@ $(function() {
loadFolder(self.currentPath()); loadFolder(self.currentPath());
} }
}) })
return false;
}) })
} }
...@@ -354,7 +363,9 @@ $(function() { ...@@ -354,7 +363,9 @@ $(function() {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
var start = new Date().getTime(); var start = new Date().getTime();
xhr.open('POST', self.uploadURL()); xhr.open('POST', self.uploadURL());
xhr.onreadystatechange=function(){console.log(xhr,arguments)}
xhr.onload = xhr.onerror = function() { xhr.onload = xhr.onerror = function() {
console.log(xhr.status);
$('.file-upload').removeClass('opened'); $('.file-upload').removeClass('opened');
$('.file-upload .details').slideUp(700); $('.file-upload .details').slideUp(700);
$('#upload-zone').show(); $('#upload-zone').show();
...@@ -393,7 +404,6 @@ $(function() { ...@@ -393,7 +404,6 @@ $(function() {
} }
} }
} }
xhr.send(formData); xhr.send(formData);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment