Skip to content
Snippets Groups Projects
Commit 3bc44f4d authored by Thomas Schneider's avatar Thomas Schneider
Browse files

Frontend: Implement live preview updates

parent 4994da03
Branches
Tags
No related merge requests found
import './main.less'; import './main.less';
console.log("Hello World"); console.log("Hello World");
function onInputHandler(event: Event) {
const preview = document.getElementById('preview') as HTMLIFrameElement;
const previewDoc = preview.contentDocument as Document;
const src = event.target as HTMLInputElement;
const dest = previewDoc.getElementById(src.id) as HTMLElement;
dest.innerText = src.value;
}
window.addEventListener("load", () => {
for (let el of document.getElementsByClassName('input-dispatch')) {
console.log(el);
el.addEventListener('input', onInputHandler);
}
});
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
{%- else -%} {%- else -%}
<div class="box"> <div class="box">
{{ field.label }} {{ field.label }}
{{ field }} {{ field(class="input-dispatch") }}
</div> </div>
{%- endif -%} {%- endif -%}
{%- endmacro %} {%- endmacro %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment