chore: clean up desktop
This commit is contained in:
1 parent
67a6fa9eb8
commit
1b14b309e9
19 files changed
+305
-298
No files matched your search
@@ -17,6 +17,9 @@ extern "C" {
|
||||
#[wasm_bindgen(method)]
|
||||
pub fn MountToRoot(this: &Interpreter);
|
||||
|
||||
#[wasm_bindgen(method)]
|
||||
pub fn AppendChildren(this: &Interpreter, m: u32);
|
||||
|
||||
#[wasm_bindgen(method)]
|
||||
pub fn AssignId(this: &Interpreter, path: &[u8], id: u32);
|
||||
|
||||
|
||||
@@ -210,7 +210,6 @@ export class Interpreter {
|
||||
}
|
||||
}
|
||||
handleEdits(edits) {
|
||||
|
||||
for (let template of edits.templates) {
|
||||
this.SaveTemplate(template);
|
||||
}
|
||||
@@ -276,7 +275,16 @@ export class Interpreter {
|
||||
}
|
||||
HydrateText(path, value, id) {
|
||||
let node = this.LoadChild(path);
|
||||
node.textContent = value;
|
||||
|
||||
if (node.nodeType == Node.TEXT_NODE) {
|
||||
node.textContent = value;
|
||||
} else {
|
||||
// replace with a textnode
|
||||
let text = document.createTextNode(value);
|
||||
node.replaceWith(text);
|
||||
node = text;
|
||||
}
|
||||
|
||||
this.nodes[id] = node;
|
||||
}
|
||||
ReplacePlaceholder(path, m) {
|
||||
|
||||
Reference in new issue
Block a user