mirror of
https://github.com/stagehacks/Cue-View.git
synced 2026-07-26 09:18:39 +00:00
create diffs directly against the current DOM
This commit is contained in:
+2
-4
@@ -50,8 +50,7 @@ function drawDeviceFrame(id) {
|
||||
</html>
|
||||
`;
|
||||
|
||||
d.contentBodyVNode = h('body', convertHtml(generateBodyHTML(d)));
|
||||
d.contentBodyElement = create(d.contentBodyVNode);
|
||||
d.contentBodyElement = create(h('body', convertHtml(generateBodyHTML(d))));
|
||||
|
||||
$deviceDrawArea.setAttribute('class', `${d.type} draw-area`);
|
||||
$deviceDrawArea.contentWindow.document.open();
|
||||
@@ -109,9 +108,8 @@ module.exports.draw = function draw(device) {
|
||||
|
||||
if (d.contentBodyElement) {
|
||||
const newVNode = h('body', convertHtml(generateBodyHTML(d)));
|
||||
const domPatches = diff(d.contentBodyVNode, newVNode);
|
||||
const domPatches = diff(d.contentBodyElement, newVNode);
|
||||
d.contentBodyElement = patch(d.contentBodyElement, domPatches);
|
||||
d.contentBodyVNode = newVNode;
|
||||
} else {
|
||||
drawDeviceFrame(d.id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user