placeholder working
This commit is contained in:
parent
0827cb387f
commit
3f962345f7
@ -18,15 +18,17 @@ import {defaultKeymap} from "@codemirror/commands"
|
|||||||
import {markdown} from "@codemirror/lang-markdown"
|
import {markdown} from "@codemirror/lang-markdown"
|
||||||
import {autocompletion} from "@codemirror/autocomplete"
|
import {autocompletion} from "@codemirror/autocomplete"
|
||||||
|
|
||||||
class PlaceholderWidget extends WidgetType { //TODO this is not working for some javascript magic reason
|
class PlaceholderWidget extends WidgetType {
|
||||||
name = undefined
|
name = undefined
|
||||||
|
|
||||||
constructor(name) {
|
constructor(name) {
|
||||||
console.log(name)
|
console.log('name:', name)
|
||||||
super()
|
super()
|
||||||
|
this.name = name
|
||||||
}
|
}
|
||||||
|
|
||||||
eq(other) {
|
eq(other) {
|
||||||
return this.name == other.name
|
return this.name === other.name
|
||||||
}
|
}
|
||||||
|
|
||||||
toDOM() {
|
toDOM() {
|
||||||
@ -37,7 +39,7 @@ class PlaceholderWidget extends WidgetType { //TODO this is not working for some
|
|||||||
padding: 0 3px;
|
padding: 0 3px;
|
||||||
background: lightblue;`
|
background: lightblue;`
|
||||||
|
|
||||||
elt.textContent = "Food"
|
elt.textContent = this.name
|
||||||
return elt
|
return elt
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,6 +100,7 @@ export default {
|
|||||||
{label: "Mehl", type: "text", apply: "{{ ingredients[1] }}", detail: "template"},
|
{label: "Mehl", type: "text", apply: "{{ ingredients[1] }}", detail: "template"},
|
||||||
{label: "Butter", type: "text", apply: "{{ ingredients[2] }}", detail: "template"},
|
{label: "Butter", type: "text", apply: "{{ ingredients[2] }}", detail: "template"},
|
||||||
{label: "Salz", type: "text", apply: "{{ ingredients[3] }}", detail: "template"},
|
{label: "Salz", type: "text", apply: "{{ ingredients[3] }}", detail: "template"},
|
||||||
|
{label: "Scale", type: "text", apply: "{{ scale(100) }}", detail: "simple scalable number"},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user