فهرست منبع

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