app/assets/lookbook/js/components/page.js in lookbook-0.5.0 vs app/assets/lookbook/js/components/page.js in lookbook-0.5.1
- old
+ new
@@ -24,10 +24,12 @@
},
async update() {
const response = await fetch(window.document.location);
if (!response.ok) return window.location.reload();
const html = await response.text();
- this.morph(new DOMParser().parseFromString(html, "text/html"));
+ const newDoc = new DOMParser().parseFromString(html, "text/html");
+ this.morph(newDoc);
+ document.title = newDoc.title;
},
setLocation(loc) {
const path = loc instanceof Event ? loc.currentTarget.href : loc;
history.pushState({}, null, path);
this.$dispatch("popstate");