Changing how optional decoding works.
This commit is contained in:
parent
dab066e61b
commit
cadce52e1b
|
@ -585,7 +585,7 @@
|
||||||
binding,
|
binding,
|
||||||
{
|
{
|
||||||
js: true,
|
js: true,
|
||||||
decode: false,
|
dontDecode: true,
|
||||||
}
|
}
|
||||||
)}
|
)}
|
||||||
mode="javascript"
|
mode="javascript"
|
||||||
|
|
|
@ -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,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue