1
0
Fork 0
mirror of synced 2024-08-16 18:41:37 +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, binding,
{ {
js: true, js: true,
decode: false, dontDecode: true,
} }
)} )}
mode="javascript" mode="javascript"

View file

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