mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-28 12:36:35 +00:00
Supress file drops outside of windows. Change drop cursors to better match Winamp
Fixes #529
This commit is contained in:
parent
d30ce2eb23
commit
d700100626
2 changed files with 12 additions and 2 deletions
|
|
@ -10,8 +10,8 @@ export default class DropTarget extends React.Component {
|
|||
supress(e) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
e.dataTransfer.dropEffect = "copy";
|
||||
e.dataTransfer.effectAllowed = "copyMove";
|
||||
e.dataTransfer.dropEffect = "link";
|
||||
e.dataTransfer.effectAllowed = "link";
|
||||
}
|
||||
|
||||
handleDrop(e) {
|
||||
|
|
|
|||
10
js/index.js
10
js/index.js
|
|
@ -36,6 +36,16 @@ const NOISY_ACTION_TYPES = new Set([
|
|||
SET_BAND_VALUE
|
||||
]);
|
||||
|
||||
function supressDragAndDrop(e) {
|
||||
e.preventDefault();
|
||||
e.dataTransfer.effectAllowed = "none";
|
||||
e.dataTransfer.dropEffect = "none";
|
||||
}
|
||||
|
||||
window.addEventListener("dragenter", supressDragAndDrop);
|
||||
window.addEventListener("dragover", supressDragAndDrop);
|
||||
window.addEventListener("drop", supressDragAndDrop);
|
||||
|
||||
let lastActionType = null;
|
||||
|
||||
// Filter out consecutive common actions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue