fix drag n drop bug
This commit is contained in:
28
js/index.js
28
js/index.js
@@ -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){
|
||||
|
||||
|
||||
Reference in New Issue
Block a user