1
0
Fork 0
mirror of synced 2024-08-09 07:08:01 +12:00

PR updates and fix for mode switch issue

This commit is contained in:
Dean 2023-05-30 14:02:18 +01:00
parent c71ad13048
commit 1a8470e949

View file

@ -150,8 +150,9 @@
} }
//Get the current mode value //Get the current mode value
const currentEditorValue = mode === "JavaScript" ? jsValue : hbsValue const editorValue = usingJS ? decodeJSBinding(jsValue) : hbsValue
if (currentEditorValue) {
if (editorValue) {
targetMode = selectedMode targetMode = selectedMode
return false return false
} }
@ -168,7 +169,7 @@
<Heading size="S"> <Heading size="S">
{`Switch to ${targetMode}?`} {`Switch to ${targetMode}?`}
</Heading> </Heading>
<Body>This will discard anything in your text</Body> <Body>This will discard anything in your binding</Body>
<div class="switch-actions"> <div class="switch-actions">
<Button <Button
secondary secondary
@ -213,8 +214,8 @@
<Icon name="FlashOn" /> <Icon name="FlashOn" />
<div class="messaging-wrap"> <div class="messaging-wrap">
<div> <div>
Add available bindings by typing $ or use the menu on Add available bindings by typing &#123;&#123; or use the
the right menu on the right
</div> </div>
</div> </div>
{/if} {/if}
@ -266,7 +267,7 @@
<Heading size="S"> <Heading size="S">
{`Switch to ${targetMode}?`} {`Switch to ${targetMode}?`}
</Heading> </Heading>
<Body>This will discard anything in your text</Body> <Body>This will discard anything in your binding</Body>
<div class="switch-actions"> <div class="switch-actions">
<Button <Button
secondary secondary
@ -275,10 +276,10 @@
targetMode = null targetMode = null
}} }}
> >
No - keep text No - keep javascript
</Button> </Button>
<Button cta size="S" on:click={switchMode}> <Button cta size="S" on:click={switchMode}>
Yes - discard text Yes - discard javascript
</Button> </Button>
</div> </div>
</div> </div>