Skip to content
Snippets Groups Projects
Commit 8135828b authored by Vincent Petry's avatar Vincent Petry
Browse files

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
parent 25fecb4f
No related branches found
No related tags found
No related merge requests found
......@@ -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() ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment