blob: d2b93d06909b1924948512471687568ce3dce3d1 [file] [log] [blame]
import {isOptionEnabled} from '../../common/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);
});
}