diff options
Diffstat (limited to 'static/js/src/drag.js')
| -rw-r--r-- | static/js/src/drag.js | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/static/js/src/drag.js b/static/js/src/drag.js index b48c365..48b3266 100644 --- a/static/js/src/drag.js +++ b/static/js/src/drag.js @@ -45,17 +45,21 @@ function dragTarget (target, callbacks) { } base.drop = function(e){ base.target.classList.remove('over'); - if (e.stopPropagation) { - e.stopPropagation(); // stops the browser from redirecting. - } - if (e.preventDefault) { - e.preventDefault(); - } + e.stopPropagation(); // stops the browser from redirecting. + e.preventDefault(); if ('drop' in callbacks) { - callbacks.drop(Drag.url); + if (e.dataTransfer) { + var url = e.dataTransfer.getData("url"); + if (url) { + callbacks.drop(url); + } + } else { + callbacks.drop(Drag.url); + } } return false; } + base.init(); }; |
