summaryrefslogtreecommitdiff
path: root/static/js/src/drag.js
diff options
context:
space:
mode:
authordumpfmprod <dumpfmprod@ubuntu.(none)>2012-12-30 20:04:41 -0500
committerdumpfmprod <dumpfmprod@ubuntu.(none)>2012-12-30 20:04:41 -0500
commit200ea4abd13eaffad5151eb62fc54a90e5346022 (patch)
treed9fab334fc616449b3fe726c050ba1cdd96cc4c9 /static/js/src/drag.js
parentfdb3b4169f8056922344e6735c77d1c7679a3953 (diff)
parentab3c66a6db7c4c2dbc3795c3b11132a535a3aeb3 (diff)
Merge branch 'master' of /pichat/repo
Diffstat (limited to 'static/js/src/drag.js')
-rw-r--r--static/js/src/drag.js18
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();
};