From 5c2360961eb8c3f2b6617723d5b805f20a067903 Mon Sep 17 00:00:00 2001 From: Felix Nüsse Date: Wed, 29 Aug 2018 11:53:43 +0200 Subject: Added Dropzone-Highlighting to Trash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Felix Nüsse --- apps/files/css/files.scss | 3 +++ apps/files/js/navigation.js | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/apps/files/css/files.scss b/apps/files/css/files.scss index bd57f1907f5..77e39d87af2 100644 --- a/apps/files/css/files.scss +++ b/apps/files/css/files.scss @@ -102,6 +102,9 @@ .nav-icon-trashbin { @include icon-color('delete', 'files', $color-black); } +.nav-icon-trashbin-starred { + @include icon-color('delete', 'files', #ff0000); +} .nav-icon-deletedshares { @include icon-color('unshare', 'files', $color-black); } diff --git a/apps/files/js/navigation.js b/apps/files/js/navigation.js index d8b249411f8..1fed29471f8 100644 --- a/apps/files/js/navigation.js +++ b/apps/files/js/navigation.js @@ -65,7 +65,23 @@ this.$el.on('click', 'li a', _.bind(this._onClickItem, this)) this.$el.on('click', 'li button', _.bind(this._onClickMenuButton, this)); - $(".nav-trashbin").droppable({ + var favListElement=$(".nav-trashbin"); + console.log(favListElement); + favListElement.droppable({ + over: function( event, ui ) { + favListElement.addClass('dropzone-background') + }, + out: function( event, ui ) { + favListElement.removeClass('dropzone-background'); + }, + activate: function( event, ui ) { + var elem=favListElement.find("a").first(); + elem.addClass('nav-icon-trashbin-starred').removeClass('nav-icon-trashbin'); + }, + deactivate: function( event, ui ) { + var elem=favListElement.find("a").first(); + elem.addClass('nav-icon-trashbin').removeClass('nav-icon-trashbin-starred'); + }, drop: function( event, ui ) { var $selectedFiles = $(ui.draggable); -- cgit v1.2.3