From ecd9d5493fcdfe929ab7c3ab4418a5404264fcd2 Mon Sep 17 00:00:00 2001 From: Nariman Jelveh Date: Fri, 3 May 2024 19:57:48 -0700 Subject: [PATCH] Fix issue with trash not opening from taskbar --- src/UI/UITaskbarItem.js | 21 ++++++++++++++++++--- src/helpers.js | 4 ++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/UI/UITaskbarItem.js b/src/UI/UITaskbarItem.js index 6d5b7e69..98e32d0d 100644 --- a/src/UI/UITaskbarItem.js +++ b/src/UI/UITaskbarItem.js @@ -113,15 +113,15 @@ 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), @@ -130,6 +130,22 @@ function UITaskbarItem(options){ }) } //------------------------------------------ + // 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), + }) + } + }) + } + //------------------------------------------ // Empty Trash //------------------------------------------ if(options.app === 'trash' && options.name === 'Trash'){ @@ -145,7 +161,6 @@ function UITaskbarItem(options){ } }) } - //------------------------------------------ // Remove from Taskbar //------------------------------------------ diff --git a/src/helpers.js b/src/helpers.js index 0c4521ea..511854f0 100644 --- a/src/helpers.js +++ b/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;