mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 03:05:12 +00:00
-> v0.0.12
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sapper",
|
||||
"version": "0.0.11",
|
||||
"version": "0.0.12",
|
||||
"description": "Combat-ready apps, engineered by Svelte",
|
||||
"main": "connect.js",
|
||||
"directories": {
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import app from '__app__';
|
||||
import { detachNode } from 'svelte/shared.js';
|
||||
|
||||
const target = document.querySelector('__selector__');
|
||||
let component;
|
||||
|
||||
const detach = node => {
|
||||
node.parentNode.removeChild(node);
|
||||
};
|
||||
|
||||
app.init(url => {
|
||||
if (url.origin !== window.location.origin) return;
|
||||
|
||||
@@ -25,9 +28,9 @@ app.init(url => {
|
||||
let end = document.querySelector('#sapper-head-end');
|
||||
|
||||
if (start && end) {
|
||||
while (start.nextSibling !== end) detachNode(start.nextSibling);
|
||||
detachNode(start);
|
||||
detachNode(end);
|
||||
while (start.nextSibling !== end) detach(start.nextSibling);
|
||||
detach(start);
|
||||
detach(end);
|
||||
}
|
||||
|
||||
target.innerHTML = '';
|
||||
|
||||
Reference in New Issue
Block a user