all repos — h3 @ 176ab9207a785a6186e7975298282b72786320ea

A tiny, extremely minimalist JavaScript microframework.

Fixed selector regexp; allowed redraw in $onrender.
h3rald h3rald@h3rald.com
Sun, 05 Jul 2020 20:11:32 +0200
commit

176ab9207a785a6186e7975298282b72786320ea

parent

bf1064da2aee3eda9c6f607f18f085bce1d47d48

1 files changed, 3 insertions(+), 3 deletions(-)

jump to
M h3.jsh3.js

@@ -59,7 +59,7 @@ }

return checkProperties(obj1, obj2); // && checkProperties(obj2, obj1); }; -const selectorRegex = /^([a-z][a-z0-9:_=-]*)(#[a-z0-9:_=-]+)?(\.[^ ]+)*$/i; +const selectorRegex = /^([a-z][a-z0-9:_=-]*)?(#[a-z0-9:_=-]+)?(\.[^ ]+)*$/i; let $onrenderCallbacks = [];

@@ -663,13 +663,13 @@ }

const vnode = newRouteComponent(newRouteComponent.state); const node = vnode.render(); this.element.appendChild(node); + this.setRedraw(vnode, newRouteComponent.state); + redrawing = false; vnode.$onrender && vnode.$onrender(node); $onrenderCallbacks.forEach((cbk) => cbk()); $onrenderCallbacks = []; - this.setRedraw(vnode, newRouteComponent.state); window.scrollTo(0, 0); this.store.dispatch("$redraw"); - redrawing = false; }; window.addEventListener("hashchange", processPath); await processPath();