show eventkey in ui for debugging purposes

This commit is contained in:
Bruno Windels 2019-06-02 18:15:24 +02:00
parent a59014475b
commit e3b4f898d0
2 changed files with 8 additions and 4 deletions

View file

@ -58,4 +58,8 @@ export default class SimpleTile {
updateNextSibling(next) { updateNextSibling(next) {
} }
get internalId() {
return this._entry.asEventKey().toString();
}
} }

View file

@ -23,7 +23,7 @@ export default class TimelineTile {
function renderTile(tile) { function renderTile(tile) {
switch (tile.shape) { switch (tile.shape) {
case "message": case "message":
return html.li(null, tile.label); return html.li(null, [html.strong(null, tile.internalId+" "), tile.label]);
case "gap": { case "gap": {
const button = html.button(null, (tile.isUp ? "🠝" : "🠟") + " fill gap"); const button = html.button(null, (tile.isUp ? "🠝" : "🠟") + " fill gap");
const handler = () => { const handler = () => {
@ -31,11 +31,11 @@ function renderTile(tile) {
button.removeEventListener("click", handler); button.removeEventListener("click", handler);
}; };
button.addEventListener("click", handler); button.addEventListener("click", handler);
return html.li(null, button); return html.li(null, [html.strong(null, tile.internalId+" "), button]);
} }
case "announcement": case "announcement":
return html.li(null, tile.label); return html.li(null, [html.strong(null, tile.internalId+" "), tile.label]);
default: default:
return html.li(null, "unknown tile shape: " + tile.shape); return html.li(null, [html.strong(null, tile.internalId+" "), "unknown tile shape: " + tile.shape]);
} }
} }