mirror of
https://github.com/HeyPuter/puter.git
synced 2026-11-06 22:13:04 +00:00
fix(dashboard): clear a drop target's highlight after the drop
jQuery UI fires no `out` on drop, so the folder row a selection was dropped on stayed selected (and went to the Trash with the next Delete), a sidebar folder stayed highlighted as the current one, and a breadcrumb kept its drop outline.
This commit is contained in:
1 parent
ac0cffe5d9
commit
3bd73a4b3f
1 file changed
+9
-1
@@ -379,6 +379,11 @@ const TabFiles = {
|
||||
clearTimeout(_this.folderDwellTimer);
|
||||
_this.folderDwellTimer = null;
|
||||
_this.folderDwellTarget = null;
|
||||
// A drop fires no `out`, so undo `over`'s highlight here.
|
||||
$(folderElement).removeClass('dwell-opening');
|
||||
if ( folderElement.getAttribute('data-path') !== _this.currentPath ) {
|
||||
$(folderElement).removeClass('active');
|
||||
}
|
||||
|
||||
// Block if ctrl and trashed
|
||||
const draggedPath = $(ui.draggable).attr('data-path');
|
||||
@@ -2527,7 +2532,8 @@ const TabFiles = {
|
||||
clearTimeout(_this.folderDwellTimer);
|
||||
_this.folderDwellTimer = null;
|
||||
_this.folderDwellTarget = null;
|
||||
$(dirnameElement).removeClass('dwell-opening');
|
||||
// A drop fires no `out`, so undo `over`'s highlight here.
|
||||
$(dirnameElement).removeClass('dwell-opening drop-target');
|
||||
|
||||
const targetPath = $(this).attr('data-path');
|
||||
const draggedPath = $(ui.draggable).attr('data-path');
|
||||
@@ -3484,6 +3490,8 @@ const TabFiles = {
|
||||
clearTimeout(_this.folderDwellTimer);
|
||||
_this.folderDwellTimer = null;
|
||||
_this.folderDwellTarget = null;
|
||||
// A drop fires no `out`, so undo `over`'s highlight here.
|
||||
$(el_item).removeClass('selected dwell-opening');
|
||||
|
||||
// A row drawn ahead of its mkdir has a predicted path, not
|
||||
// a real one. Moving into it would either fail or — because
|
||||
|
||||
Reference in new issue
Block a user