fix drag n drop bug

This commit is contained in:
pg
2015-10-10 03:59:36 +02:00
parent 836711dd69
commit 2a50c2b180
6 changed files with 41 additions and 6 deletions

View File

@@ -40,7 +40,22 @@ var dataSet = [
//$(document).foundation();
$(document).ready(function(){
document.addEventListener('dragover',function(event){
event.preventDefault();
return false;
},false);
document.addEventListener('drop',function(event){
event.preventDefault();
return false;
},false);
$('#a_report').click( function() {
$(".menu a").removeClass('active');
$('#a_report').addClass("active");
@@ -70,6 +85,19 @@ $('#a_msg').click( function() {
$("#panel2-4").addClass("active");
})
var holder = document.getElementById('dragdrop');
holder.ondragover = function () {
return false;
};
holder.ondragleave = holder.ondragend = function () {
return false;
};
holder.ondrop = function (e) {
e.preventDefault();
var file = e.dataTransfer.files[0];
console.log('File you dragged here is', file.path);
return false;
};
var line_plot = function (elt, data){