From ac873cffc3c280d3d1ba01e00ff7a3681a8ef04c Mon Sep 17 00:00:00 2001 From: urkerab Date: Tue, 18 Aug 2015 12:18:47 +0100 Subject: [PATCH] Allow default text field drag and drop behaviour. --- js/client.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/client.js b/js/client.js index ad99a5e0d..597469c93 100644 --- a/js/client.js +++ b/js/client.js @@ -26,9 +26,13 @@ } }); $(window).on('dragover', function (e) { + if (/^text/.test(e.target.type)) return; // Ignore text fields + e.preventDefault(); }); $(document).on('dragenter', function (e) { + if (/^text/.test(e.target.type)) return; // Ignore text fields + e.preventDefault(); if (!app.dragging && app.curRoom.id === 'teambuilder') { @@ -50,6 +54,8 @@ e.originalEvent.dataTransfer.dropEffect = 'move'; }); $(window).on('drop', function (e) { + if (/^text/.test(e.target.type)) return; // Ignore text fields + // The default team drop action for Firefox is to open the team as a // URL, which needs to be prevented. // The default file drop action for most browsers is to open the file