Skip to content

Commit

Permalink
morphdom Also Patch Head
Browse files Browse the repository at this point in the history
  • Loading branch information
s0kil committed Jul 24, 2021
1 parent c6a2a18 commit 70163d6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/IHP/static/livereload.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ function refresh() {
.then(html => {
var parser = new DOMParser();
var dom = parser.parseFromString(html, 'text/html');

// https://github.com/digitallyinduced/ihp/issues/998
morphdom(document.head, dom.head)

morphdom(document.body, dom.body, {
getNodeKey: function (el) {

Expand Down Expand Up @@ -54,7 +58,7 @@ function refresh() {

window.clearAllIntervals();
window.clearAllTimeouts();

var event = new CustomEvent('turbolinks:load', {});
document.dispatchEvent(event);
});
Expand Down

0 comments on commit 70163d6

Please sign in to comment.