summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-12-09 16:03:23 +0100
committerVincent Petry <pvince81@owncloud.com>2014-01-14 19:17:23 +0100
commit8135828b2ed411c06bcde3a2c3c738ecfa821714 (patch)
tree3e4cdc12ba344179d353840a9a73ea2bda125e6e /apps
parent25fecb4f25ce5d229a075046a5a985f22dc7f830 (diff)
downloadnextcloud-server-8135828b2ed411c06bcde3a2c3c738ecfa821714.tar.gz
nextcloud-server-8135828b2ed411c06bcde3a2c3c738ecfa821714.zip
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
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/filelist.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index c02ab70ce8d..30aea9c8c8d 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -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() ) {