From f8b8f09a74251936057ba840ce0bdf82b2804b26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Benqu=C3=A9?= Date: Fri, 13 Mar 2020 09:40:52 +0000 Subject: [PATCH] highlight trash on drag --- www/kanban/app-kanban.less | 5 +++++ www/kanban/jkanban.js | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/www/kanban/app-kanban.less b/www/kanban/app-kanban.less index 1aa4cba5c..f79b71013 100644 --- a/www/kanban/app-kanban.less +++ b/www/kanban/app-kanban.less @@ -430,6 +430,11 @@ background: fade(@colortheme_notification-warn, 20%); } } + &.kanban-trash-suggest { + div { + background: fade(@cryptpad_text_col, 20%); + } + } .kanban-item, .kanban-board { display: none; } diff --git a/www/kanban/jkanban.js b/www/kanban/jkanban.js index 27abb1de6..db5a258f8 100644 --- a/www/kanban/jkanban.js +++ b/www/kanban/jkanban.js @@ -171,22 +171,26 @@ if (typeof (el.dragfn) === 'function') { el.dragfn(el, source); } + $('.kanban-trash').addClass('kanban-trash-suggest'); $(document).on('mousemove', onMouseMove()); }) .on('dragend', function (el) { el.classList.remove('is-moving'); self.options.dragendBoard(el); $(document).off('mousemove'); + $('.kanban-trash').removeClass('kanban-trash-suggest'); if (typeof (el.dragendfn) === 'function') el.dragendfn(el); }) .on('over', function (el, target, source) { if (!target.classList.contains('kanban-trash')) { return false; } $('.kanban-trash').addClass('kanban-trash-active'); + $('.kanban-trash').removeClass('kanban-trash-suggest'); }) .on('out', function (el, target) { if (!target.classList.contains('kanban-trash')) { return false; } $('.kanban-trash').removeClass('kanban-trash-active'); + $('.kanban-trash').addClass('kanban-trash-suggest'); }) .on('drop', function (el, target, source, sibling) { el.classList.remove('is-moving'); @@ -253,6 +257,7 @@ setActiveDrag(); el.classList.add('is-moving'); $(document).on('mousemove', onMouseMove(el)); + $('.kanban-trash').addClass('kanban-trash-suggest'); self.options.dragEl(el, source); if (el !== null && typeof (el.dragfn) === 'function') { @@ -263,6 +268,7 @@ console.log("In dragend"); el.classList.remove('is-moving'); self.options.dragendEl(el); + $('.kanban-trash').removeClass('kanban-trash-suggest'); $(document).off('mousemove'); if (el !== null && typeof (el.dragendfn) === 'function') { el.dragendfn(el); @@ -277,12 +283,16 @@ .on('over', function (el, target, source) { setActiveDrag(target); if (!target.classList.contains('kanban-trash')) { return false; } + target.classList.remove('kanban-trash-suggest'); target.classList.add('kanban-trash-active'); + }) .on('out', function (el, target) { setActiveDrag(); if (!target.classList.contains('kanban-trash')) { return false; } target.classList.remove('kanban-trash-active'); + target.classList.add('kanban-trash-suggest'); + }) .on('drop', function(el, target, source, sibling) { self.enableAllBoards();