Skip to content

Commit

Permalink
fix header buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
heapwolf committed Mar 24, 2024
1 parent 03ccc3e commit fe6cb08
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/css/tonic-overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ tonic-accordion-section .tonic--accordion-header button .tonic--label {
tonic-accordion-section .tonic--accordion-header button[aria-expanded="true"] .tonic--label {
text-decoration: underline;
text-underline-offset: 2px;
color: var(--tonic-accent);
}

tonic-accordion-section .tonic--accordion-header button {
Expand Down
18 changes: 13 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,10 @@ class AppView extends Tonic {
this.activatePreviewWindows()
}

async addSharedProject () {
const coDialogSubscribe = document.querySelector('dialog-subscribe')
if (coDialogSubscribe) coDialogSubscribe.show()
}

async createProject () {
const dest = path.join(path.DATA, 'projects', 'new-project')
Expand Down Expand Up @@ -597,8 +601,7 @@ class AppView extends Tonic {
}

case 'Add Shared Project': {
const coDialogSubscribe = document.querySelector('dialog-subscribe')
if (coDialogSubscribe) coDialogSubscribe.show()
this.addSharedProject()
break
}

Expand Down Expand Up @@ -675,7 +678,12 @@ class AppView extends Tonic {
this.exportProject()
}

if (event === 'publish') {
if (event === 'create-new-project') {
this.createProject()
}

if (event === 'add-shared-project') {
this.addSharedProject()
}
}

Expand All @@ -697,9 +705,9 @@ class AppView extends Tonic {
<tonic-split-left width="25%">
<header class="component" id="header-project">
<span class="spacer"></span>
<tonic-button type="icon" size="18px" symbol-id="plus-icon" title="Create a new project" data-event="run">
<tonic-button type="icon" size="18px" symbol-id="plus-icon" title="Create a new project" data-event="create-new-project">
</tonic-button>
<tonic-button type="icon" size="24px" symbol-id="collaborate-icon" title="Import a shared project" data-event="run">
<tonic-button type="icon" size="24px" symbol-id="collaborate-icon" title="Import a shared project" data-event="add-shared-project">
</tonic-button>
</header>
<app-project id="app-project" parent=${this}></app-project>
Expand Down

0 comments on commit fe6cb08

Please sign in to comment.