diff options
author | Felix Nüsse <Felix.nuesse@t-online.de> | 2018-08-28 18:21:46 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-10-02 08:15:05 +0200 |
commit | 2b0fbf7b89b3b7dc6a1382169ee4899a17e12bc2 (patch) | |
tree | d6df8e4deda794b64d4bf61e33e5fe34a28529e1 /apps/files/js/navigation.js | |
parent | 77c6e4106359776bc7283801fa36008596981444 (diff) | |
download | nextcloud-server-2b0fbf7b89b3b7dc6a1382169ee4899a17e12bc2.tar.gz nextcloud-server-2b0fbf7b89b3b7dc6a1382169ee4899a17e12bc2.zip |
Added Trash-Dropzone to easily dispose of files and folders
Signed-off-by: Felix Nüsse <Felix.nuesse@t-online.de>
Diffstat (limited to 'apps/files/js/navigation.js')
-rw-r--r-- | apps/files/js/navigation.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/apps/files/js/navigation.js b/apps/files/js/navigation.js index 9fc2180c923..d8b249411f8 100644 --- a/apps/files/js/navigation.js +++ b/apps/files/js/navigation.js @@ -64,6 +64,23 @@ _setupEvents: function () { this.$el.on('click', 'li a', _.bind(this._onClickItem, this)) this.$el.on('click', 'li button', _.bind(this._onClickMenuButton, this)); + + $(".nav-trashbin").droppable({ + drop: function( event, ui ) { + + var $selectedFiles = $(ui.draggable); + + if (ui.helper.find("tr").size()===1) { + var $tr = $selectedFiles.closest('tr'); + $selectedFiles.trigger("droppedOnTrash", $tr.attr("data-file"), $tr.attr('data-dir')); + }else{ + var item = ui.helper.find("tr"); + for(var i=0; i<item.length;i++){ + $selectedFiles.trigger("droppedOnTrash", item[i].getAttribute("data-file"), item[i].getAttribute("data-dir")); + } + } + } + }); }, /** |