diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-12-09 16:03:23 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-01-14 19:17:23 +0100 |
commit | 8135828b2ed411c06bcde3a2c3c738ecfa821714 (patch) | |
tree | 3e4cdc12ba344179d353840a9a73ea2bda125e6e /apps | |
parent | 25fecb4f25ce5d229a075046a5a985f22dc7f830 (diff) | |
download | nextcloud-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.js | 5 |
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() ) { |