summaryrefslogtreecommitdiff
path: root/static/js/pichat2.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/js/pichat2.js')
-rw-r--r--static/js/pichat2.js21
1 files changed, 13 insertions, 8 deletions
diff --git a/static/js/pichat2.js b/static/js/pichat2.js
index 5f20803..ceeb397 100644
--- a/static/js/pichat2.js
+++ b/static/js/pichat2.js
@@ -445,7 +445,7 @@ function removeOldMessages(){
}
}
-window.TextEnabled = Preferences.getProperty("chat.textEnabled", "true") == "none";
+window.TextEnabled = Preferences.getProperty("chat.textEnabled", "true") == "true";
window.ImgsEnabled = Preferences.getProperty("chat.imgsEnabled", "true") == "true";
function muteSelector() {
@@ -547,6 +547,7 @@ function dragTarget (target, callbacks) {
}
base.enter = function(e){
base.target.classList.add('over');
+ console.log(e.target);
if ('enter' in callbacks) {
callbacks.enter(Drag.url);
}
@@ -577,17 +578,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();
};