ソースを参照

Fix issue with trash not opening from taskbar

Nariman Jelveh 1 年間 前
コミット
ecd9d5493f
2 ファイル変更20 行追加5 行削除
  1. 18 3
      src/UI/UITaskbarItem.js
  2. 2 2
      src/helpers.js

+ 18 - 3
src/UI/UITaskbarItem.js

@@ -113,17 +113,33 @@ function UITaskbarItem(options){
         // -------------------------------------------
         if(menu_items.length > 0)
             menu_items.push('-');
-
         //------------------------------------------
         // New Window
         //------------------------------------------
-        if(options.app){
+        if(options.app && options.app !== 'trash'){
             menu_items.push({
                 html: 'New Window',
                 val: $(this).attr('data-id'),
+                onClick: function(){
+                    // is trash?
+                    window.launch_app({
+                        name: options.app,
+                        maximized: (isMobile.phone || isMobile.tablet),
+                    })
+                }
+            })
+        }
+        //------------------------------------------
+        // Open Trash
+        //------------------------------------------
+        else if(options.app && options.app === 'trash'){
+            menu_items.push({
+                html: 'Open Trash',
+                val: $(this).attr('data-id'),
                 onClick: function(){
                     window.launch_app({
                         name: options.app,
+                        path: window.trash_path,
                         maximized: (isMobile.phone || isMobile.tablet),
                     })
                 }
@@ -145,7 +161,6 @@ function UITaskbarItem(options){
                 }
             })
         }
-
         //------------------------------------------
         // Remove from Taskbar
         //------------------------------------------

+ 2 - 2
src/helpers.js

@@ -1534,7 +1534,6 @@ window.move_clipboard_items = function (el_target_container, target_path){
  * let filePaths = ['/path/to/file1.txt', '/path/to/file2.png'];
  * window.trigger_download(filePaths);
  */
-
 window.trigger_download = (paths)=>{
     let urls = [];
     for (let index = 0; index < paths.length; index++) {
@@ -1619,7 +1618,7 @@ window.launch_app = async (options)=>{
     //------------------------------------
     // Explorer
     //------------------------------------
-    if(options.name === 'explorer'){
+    if(options.name === 'explorer' || options.name === 'trash'){
         process = new PseudoProcess({
             uuid,
             name: 'explorer',
@@ -1637,6 +1636,7 @@ window.launch_app = async (options)=>{
         }
         else if(options.path === window.trash_path){
             title = 'Trash';
+            icon = window.icons['trash.svg'];
         }
         else if(!options.path)
             title = window.root_dirname;