Skip to content

Commit

Permalink
Process item click as "open item in new window"
Browse files Browse the repository at this point in the history
  • Loading branch information
waxlamp committed Jan 31, 2024
1 parent 8e24f8b commit 9b95460
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions web/src/views/FileBrowserView/FileBrowser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
v-for="item in items"
:key="item.path"
color="primary"
@click="selectPath(item)"
@click="openItem(item)"
>
<v-icon
class="mr-2"
Expand Down Expand Up @@ -447,12 +447,16 @@ function locationSlice(index: number) {
return `${splitLocation.value.slice(0, index + 1).join('/')}/`;
}
function selectPath(item: AssetPath) {
function openItem(item: AssetPath) {
const { asset, path } = item;
// Return early if path is a file
if (asset) { return; }
location.value = path;
if (asset) {
// If the item is an asset, open it in a new window
window.open(inlineURI(asset.asset_id), '_blank', 'noreferrer');
} else {
// If it's a directory, move into it.
location.value = path;
}
}
function navigateToParent() {
Expand Down

0 comments on commit 9b95460

Please sign in to comment.