1
0
Fork 0
mirror of synced 2024-07-07 15:25:52 +12:00

Changing how optional decoding works.

This commit is contained in:
mike12345567 2024-02-02 11:28:54 +00:00
parent dab066e61b
commit cadce52e1b
2 changed files with 5 additions and 5 deletions

View file

@ -585,7 +585,7 @@
binding,
{
js: true,
decode: false,
dontDecode: true,
}
)}
mode="javascript"

View file

@ -9,11 +9,11 @@ export class BindingHelpers {
}
// Adds a JS/HBS helper to the expression
onSelectHelper(value, helper, { js }) {
onSelectHelper(value, helper, { js, dontDecode }) {
const pos = this.getCaretPosition()
const { start, end } = pos
if (js) {
const jsVal = decodeJSBinding(value)
const jsVal = dontDecode ? value : decodeJSBinding(value)
const insertVal = jsInsert(jsVal, start, end, helper.text, {
helper: true,
})
@ -25,10 +25,10 @@ export class BindingHelpers {
}
// Adds a data binding to the expression
onSelectBinding(value, binding, { js, decode }) {
onSelectBinding(value, binding, { js, dontDecode }) {
const { start, end } = this.getCaretPosition()
if (js) {
const jsVal = decode ? decodeJSBinding(value) : value
const jsVal = dontDecode ? value : decodeJSBinding(value)
const insertVal = jsInsert(jsVal, start, end, binding.readableBinding, {
disableWrapping: this.disableWrapping,
})