aboutsummaryrefslogtreecommitdiffstats
path: root/files
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-12-11 23:42:22 +0100
committerRobin Appelman <icewind1991@gmail.com>2011-12-11 23:42:22 +0100
commit9fdd1bafdc2aafcf27b939ba259818830f2df25e (patch)
treee3adba60b879b3b6199abbbd5457807435ff4791 /files
parentefecb694eff7129d1ca24627ac366f3bcc939864 (diff)
parent5e711f37ca3f009317a3c8cd0e47ed4f15922142 (diff)
downloadnextcloud-server-9fdd1bafdc2aafcf27b939ba259818830f2df25e.tar.gz
nextcloud-server-9fdd1bafdc2aafcf27b939ba259818830f2df25e.zip
Merge branch 'master' into filesystem
Diffstat (limited to 'files')
-rw-r--r--files/js/filelist.js11
-rw-r--r--files/js/files.js8
2 files changed, 10 insertions, 9 deletions
diff --git a/files/js/filelist.js b/files/js/filelist.js
index 5740ece9716..16f73ed58d6 100644
--- a/files/js/filelist.js
+++ b/files/js/filelist.js
@@ -125,7 +125,7 @@ FileList={
tr.data('renaming',true);
var td=tr.children('td.filename');
var input=$('<input class="filename"></input>').val(name);
- var form=$('<form action="#"></form>')
+ var form=$('<form></form>')
form.append(input);
td.children('a.name').text('');
td.children('a.name').append(form)
@@ -134,7 +134,6 @@ FileList={
event.stopPropagation();
event.preventDefault();
var newname=input.val();
- tr.data('renaming',false);
tr.attr('data-file',newname);
td.children('a.name').empty();
if(newname.indexOf('.')>0){
@@ -148,12 +147,12 @@ FileList={
if(newname.indexOf('.')>0){
span.append($('<span class="extention">'+newname.substr(newname.lastIndexOf('.'))+'</span>'));
}
- $.ajax({
- url: 'ajax/rename.php',
- data: { dir : $('#dir').val(), newname: newname, file: name }
+ $.get(OC.filePath('files','ajax','rename.php'), { dir : $('#dir').val(), newname: newname, file: name },function(){
+ tr.data('renaming',false);
});
+ return false;
});
- form.click(function(event){
+ input.click(function(event){
event.stopPropagation();
event.preventDefault();
});
diff --git a/files/js/files.js b/files/js/files.js
index 3e1bffccca5..b500ecfed70 100644
--- a/files/js/files.js
+++ b/files/js/files.js
@@ -14,8 +14,8 @@ $(document).ready(function() {
$('#fileList tr td.filename').draggable(dragOptions);
$('#fileList tr[data-type="dir"] td.filename').droppable(folderDropOptions);
$('div.crumb').droppable(crumbDropOptions);
- $('#plugins>ul>li:first-child').data('dir','');
- $('#plugins>ul>li:first-child').droppable(crumbDropOptions);
+ $('ul#apps>li:first-child').data('dir','');
+ $('ul#apps>li:first-child').droppable(crumbDropOptions);
// Triggers invisible file input
$('.file_upload_button_wrapper').live('click', function() {
@@ -70,7 +70,9 @@ $(document).ready(function() {
procesSelection();
} else {
var filename=$(this).parent().parent().attr('data-file');
- if(!FileList.isLoading(filename)){
+ var tr=$('tr').filterAttr('data-file',filename);
+ var renaming=tr.data('renaming')
+ if(!renaming && !FileList.isLoading(filename)){
var mime=$(this).parent().parent().data('mime');
var type=$(this).parent().parent().data('type');
var action=FileActions.getDefault(mime,type);