Skip to content

Commit

Permalink
Merge pull request #270 from lincbrain/ak-remove-list
Browse files Browse the repository at this point in the history
Make webknossos own button outside of nav bar elements for opening new window
  • Loading branch information
aaronkanzer authored Oct 11, 2024
2 parents 63d3a04 + 544ff6e commit 893056c
Showing 1 changed file with 45 additions and 11 deletions.
56 changes: 45 additions & 11 deletions web/src/components/AppBar/AppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
:href="navItem.external && navItem.text !== 'WebKNOSSOS' ? navItem.to : undefined"
:target="navItem.external && navItem.text !== 'WebKNOSSOS' ? '_blank' : undefined"
:rel="navItem.external && navItem.text !== 'WebKNOSSOS' ? 'noopener' : undefined"
@click.stop.prevent="navItem.onClick ? navItem.onClick() : null"
exact
text
>
Expand Down Expand Up @@ -48,6 +47,24 @@
</v-icon>
</v-list-item>
</template>
<v-list-item
@click.stop.prevent="handleWebKNOSSOSClick()"
exact
text
>
<v-list-item-content
text
class="text-md"
>
WebKNOSSOS
</v-list-item-content>
<v-icon
class="ml-1"
small
>
mdi-open-in-new
</v-icon>
</v-list-item>
</v-list-item-group>
</v-list>
</v-menu>
Expand Down Expand Up @@ -88,6 +105,31 @@
</v-icon>
</v-btn>
</template>
<v-btn
exact
text
@click.stop.prevent="handleWebKNOSSOSClick"
class="justify-start"
style="padding-left: 0;"
>
<v-list-item
exact
text
>
<v-list-item-content
text
class="text-md"
>
WebKNOSSOS
</v-list-item-content>
<v-icon
class="ml-1"
small
>
mdi-open-in-new
</v-icon>
</v-list-item>
</v-btn>
</v-toolbar-items>

<v-spacer />
Expand Down Expand Up @@ -194,15 +236,7 @@ const navItems: NavigationItem[] = [
text: 'JupyterHub',
to: lincHubUrl,
external: true,
},
{
text: 'WebKNOSSOS',
to: lincWebKNOSSOSUrl,
external: true, // window.open is called in the function
onClick: () => {
handleWebKNOSSOSClick();
},
},
}
];
function login() {
Expand All @@ -221,7 +255,7 @@ async function handleWebKNOSSOSClick() {
});
const data = await response.json();
console.log(data);
await sleep(1000);
await sleep(2000);
window.open(lincWebKNOSSOSUrl, '_blank');
} catch (error) {
console.error('Login to WebKNOSSOS failed:', error);
Expand Down

0 comments on commit 893056c

Please sign in to comment.