mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-25 08:06:51 +00:00
Add range node + default mods
This commit is contained in:
@@ -31,15 +31,23 @@ export class TreeView implements ModelListener {
|
||||
return id
|
||||
}
|
||||
|
||||
registerClick(callback: (el: Element) => void): string {
|
||||
registerEvent(type: string, callback: (el: Element) => void): string {
|
||||
return this.register(el => {
|
||||
el.addEventListener('click', evt => {
|
||||
el.addEventListener(type, evt => {
|
||||
callback(el)
|
||||
evt.stopPropagation()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
registerChange(callback: (el: Element) => void): string {
|
||||
return this.registerEvent('change', callback)
|
||||
}
|
||||
|
||||
registerClick(callback: (el: Element) => void): string {
|
||||
return this.registerEvent('click', callback)
|
||||
}
|
||||
|
||||
render() {
|
||||
this.target.innerHTML = this.model.schema.render(new Path(), this.model.data, this)
|
||||
for (const id in this.registry) {
|
||||
|
||||
Reference in New Issue
Block a user