فهرست منبع

[notebook] Hide drop file message if the drag event doesn't have one or more files attached to it

Enrico Berti 10 سال پیش
والد
کامیت
8256b024ad
1فایلهای تغییر یافته به همراه6 افزوده شده و 2 حذف شده
  1. 6 2
      desktop/libs/notebook/src/notebook/templates/editor_components.mako

+ 6 - 2
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -1037,7 +1037,12 @@ from desktop.views import _ko
       evt.preventDefault();
       var dt = evt.dataTransfer;
       var files = dt.files;
-      showHoverMsg();
+      if (files.length > 0){
+        showHoverMsg();
+      }
+      else {
+        hideHoverMsg();
+      }
 
       function addMarkdown(content) {
         var snip = viewModel.notebooks()[0].addSnippet({type: "text", result: {}}, true);
@@ -1079,7 +1084,6 @@ from desktop.views import _ko
             $(".hoverText").html("<i class='fa fa-spinner fa-spin'></i>");
             try {
               var loaded = JSON.parse(e.target.result);
-
               if (loaded.cells) { //ipython
                 loaded.cells.forEach(function (cell, cellCnt) {
                   window.setTimeout(function () {