blob: 08390714805be2530d68b70de34e97c86c9b3cfe [file] [log] [blame]
import {isOptionEnabled} from '../../common/options/optionsUtils.js';
export function applyDragAndDropFix(node) {
console.debug('Adding link drag&drop fix to ', node);
node.addEventListener('drop', e => {
if (e.dataTransfer.types.includes('text/uri-list')) {
e.stopImmediatePropagation();
console.debug('Stopping link drop event propagation.');
}
}, true);
}
export function applyDragAndDropFixIfEnabled(node) {
isOptionEnabled('ccdragndropfix').then(isEnabled => {
if (isEnabled) applyDragAndDropFix(node);
});
}