diff --git a/inginious/frontend/static/js/studio.js b/inginious/frontend/static/js/studio.js index d309f8dca..30a714606 100644 --- a/inginious/frontend/static/js/studio.js +++ b/inginious/frontend/static/js/studio.js @@ -691,15 +691,16 @@ function drag_drop_handler() { // Drag enter $(".upload-area").on('dragenter', function (e) { - $("#edit_task_tabs_content").append("
Drag a file here
"); + $("#dragtext").css("visibility", "visible"); + $(this).addClass("dragin"); e.stopPropagation(); e.preventDefault(); - }); // Drag over $(".upload-area").on('dragover', function (e) { $(this).addClass("dragin"); + $("#dragtext").css("visibility", "visible"); e.stopPropagation(); e.preventDefault(); @@ -707,12 +708,14 @@ function drag_drop_handler() { $(".upload-area").on('dragleave',function(e){ $(this).removeClass("dragin"); - $("#dragtext").remove(); + $("#dragtext").css("visibility", "hidden"); + e.stopPropagation(); + e.preventDefault(); }); // Drop $(".upload-area").on('drop', function (e) { - $("#dragtext").remove(); + $("#dragtext").css("visibility", "hidden"); e.stopPropagation(); e.preventDefault(); @@ -723,11 +726,6 @@ function drag_drop_handler() { uploadData(fd); }); - // Open file selector on div click - $(".upload-area").click(function(){ - $("#file").click(); - }); - // file selected $("#file").change(function(){ var fd = new FormData(); diff --git a/inginious/frontend/templates/taskset_admin/edit_tabs/files.html b/inginious/frontend/templates/taskset_admin/edit_tabs/files.html index 1a6eb78fd..85d9f327b 100644 --- a/inginious/frontend/templates/taskset_admin/edit_tabs/files.html +++ b/inginious/frontend/templates/taskset_admin/edit_tabs/files.html @@ -1,7 +1,8 @@ {# This file is part of INGInious. See the LICENSE and the COPYRIGHTS files for #} {# more information about the licensing of this file. #} -{{_("Path")}} | {{_("Download")}} | @@ -66,4 +67,4 @@ drag_drop_handler(); - +
---|