Przeglądaj źródła

Fixed context menu buig

Toby Chui 2 lat temu
rodzic
commit
430012bbcb
1 zmienionych plików z 8 dodań i 9 usunięć
  1. 8 9
      web/SystemAO/file_system/file_explorer.html

+ 8 - 9
web/SystemAO/file_system/file_explorer.html

@@ -354,7 +354,7 @@
         </div>
 
         <!-- Context Menu -->
-        <div id="contextmenu" class="contextmenu" style="min-width:250px; display: hidden;">
+        <div id="contextmenu" class="contextmenu" style="min-width:250px;">
             <div class="item" onclick="openViaButton();">
                 <i class="folder open icon"></i> <span locale="contextmenu/open">Open</span>
             </div>
@@ -534,7 +534,8 @@
             let isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
 
             //Intiiation functions
-            $(document).ready(function(){ 
+            $(document).ready(function(){
+                $("#contextmenu").css("display", "hidden");
                 if (applocale){
                     //Applocale found. Do localization
                     applocale.init("../locale/file_explorer.json", function(){
@@ -1007,7 +1008,7 @@
 
                 }else if (viewMode == "details"){
                     //Append the table structure to the corrisponding elements
-                    $("#folderList").append(`<table class="ui very basic unstackable table"  style="padding-right: 2em;">
+                    $("#folderList").append(`<table class="ui very basic unstackable table detailstable"  style="padding-right: 2em;">
                         <thead>
                             <tr>
                                 <th style="white-space: nowrap !important;"><span class="foldercounter"></span>${applocale.getString("view/details/folders", " Folders")}</th>
@@ -1019,7 +1020,7 @@
                             
                         </tbody>
                     </table>`);
-                    $("#fileList").append(`<table class="ui very basic compact unstackable table" style="padding-right: 2em;">
+                    $("#fileList").append(`<table class="ui very basic compact unstackable table detailstable" style="padding-right: 2em;">
                         <thead>
                             <tr>
                                 <th><span class="filecounter"></span>${applocale.getString("view/details/files", " Files")}</th>
@@ -1610,10 +1611,6 @@
 
                     }
 
-
-
-                    calculateContextMenuOffsets(evt);
-
                     //Show all options by defaults
                     $("#contextmenu").find(".item").show();
                     $("#contextmenu").find(".vroothide").show();
@@ -1671,13 +1668,15 @@
                         }
                     });
 
+                    calculateContextMenuOffsets(evt);
+
                     //Disable scroll on folderView
                     //$("#folderView").addClass("fixscroll");
                 });
 
                 //Right click on empty space of the file selector
                $("#folderView").off("contextmenu").on("contextmenu", function(e){
-                   if ($(e.target).attr("id") == "folderView" || $(e.target).attr("id") == "fileList" || $(e.target).attr("id") == "folderList"){
+                   if ($(e.target).attr("id") == "folderView" || $(e.target).attr("id") == "fileList" || $(e.target).attr("id") == "folderList" || $(e.target).is("table") || $(e.target).is("th")){
                        //Context menu on the empty space of the folder / file list
                         e.preventDefault();
                         $("#contextmenu").find(".item").hide();