PR updates and fix for mode switch issue
This commit is contained in:
parent
c71ad13048
commit
1a8470e949
1 changed files with 9 additions and 8 deletions
|
@ -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 {{ 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>
|
||||||
|
|
Loading…
Reference in a new issue