Fix to not destroy draggable when no draggable was set

When a dir has no delete permission, the draggable isn't initialized on
files. This fix makes sure we don't try to destroy a draggable when it
wasn't inited in the first place.

Fixes #6254
This commit is contained in:
Vincent Petry 2013-12-09 16:03:23 +01:00
parent 25fecb4f25
commit 8135828b2e
1 changed files with 4 additions and 1 deletions

View File

@ -300,7 +300,10 @@ var FileList={
},
remove:function(name){
var fileEl = FileList.findFileEl(name);
fileEl.find('td.filename').draggable('destroy');
if (fileEl.data('permissions') & OC.PERMISSION_DELETE) {
// file is only draggable when delete permissions are set
fileEl.find('td.filename').draggable('destroy');
}
fileEl.remove();
FileList.updateFileSummary();
if ( ! $('tr[data-file]').exists() ) {