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:
parent
25fecb4f25
commit
8135828b2e
|
@ -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() ) {
|
||||
|
|
Loading…
Reference in New Issue