Skip to content

Commit 6927653

Browse files
Fix rack reset functionallity (#18)
1 parent 4a006fb commit 6927653

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

core/src/rack/Bar.svelte

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
3636
const onReset = () => {
3737
stateReset();
38+
showResetDialog = false;
3839
};
3940
4041
const onToggleResetDialog = () => {
@@ -123,12 +124,12 @@
123124
.reset h6 {
124125
font-size: 13px;
125126
font-weight: 600;
126-
margin-bottom: 12px;
127+
margin-bottom: 18px;
127128
}
128129
129130
.reset p {
130131
display: block;
131-
margin-bottom: 18px;
132+
margin-bottom: 24px;
132133
text-align: left;
133134
}
134135
@@ -141,9 +142,6 @@
141142
142143
.reset button:last-of-type {
143144
margin-left: 16px;
144-
}
145-
146-
.reset button[type='submit'] {
147145
color: var(--color-5);
148146
}
149147
</style>
@@ -179,19 +177,19 @@
179177
</Menu>
180178
</nav>
181179
<div>
182-
{#if !api}
180+
{#if api}
183181
<Share {api} bind:title />
184182
{/if}
185183
</div>
186184
<div />
187185
<Dialog bind:visible={showResetDialog}>
188-
<form class="reset">
186+
<div class="reset">
189187
<h6>Do you want to clear the current patch?</h6>
190188
<p>Your changes on current patch will be lost.</p>
191189
<div>
192-
<button on:click={onToggleResetDialog} type="button">Cancel</button>
193-
<button on:click={onReset} type="submit">Clear</button>
190+
<button type="button" on:click={onToggleResetDialog}>Cancel</button>
191+
<button type="button" on:click={onReset}>Clear</button>
194192
</div>
195-
</form>
193+
</div>
196194
</Dialog>
197195
</header>

core/src/rack/Menu.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@
6666
padding: 8px;
6767
}
6868
69-
:global(ul.menu form button, .dialog form button) {
69+
:global(ul.menu form button, .dialog button) {
7070
padding: 8px 0;
7171
background: var(--color-ui-hover);
7272
justify-content: center;
7373
}
7474
75-
:global(ul.menu form button:hover, .dialog form button:hover) {
75+
:global(ul.menu form button:hover, .dialog button:hover) {
7676
background: var(--color-ui-bg-secondary);
7777
}
7878

0 commit comments

Comments
 (0)