diff --git a/demo/projector.html b/demo/projector.html
index aab37fd..b30d5f8 100644
--- a/demo/projector.html
+++ b/demo/projector.html
@@ -59,12 +59,13 @@
const projector = document.querySelector('folk-projector');
- function createSpreadsheetEditor(shape) {
+ function XYCell(shape) {
const editor = document.createElement('div');
const xInput = document.createElement('input');
const yInput = document.createElement('input');
+ xInput.type = 'number';
+ yInput.type = 'number';
- [xInput, yInput].forEach((input) => (input.type = 'number'));
xInput.value = shape.x;
yInput.value = shape.y;
@@ -78,8 +79,7 @@
const shapes = document.querySelectorAll('folk-shape');
shapes.forEach((shape) => {
- projector.mapping(shape, createSpreadsheetEditor);
- console.log(shape);
+ projector.mapping(shape, XYCell);
});
document.addEventListener('keydown', (event) => {
@@ -87,6 +87,12 @@
projector.project();
}
});
+
+ document.addEventListener('click', (event) => {
+ if (event.target === document.body) {
+ projector.project();
+ }
+ });