Drop .before, .after, .prepend, .append

This commit is contained in:
eight 2017-09-12 04:10:20 +08:00
parent e2ea93a3c7
commit 5fecd7e91b

View File

@ -89,9 +89,9 @@ function initInstallPage({style, dup}, sourceLoader) {
</div> </div>
`)); `));
if (versionTest < 0) { if (versionTest < 0) {
$('.actions').before(tHTML(` $('.actions').parentNode.insertBefore(tHTML(`
<div class="warning" i18n-text="versionInvalidOlder"></div> <div class="warning" i18n-text="versionInvalidOlder"></div>
`)); `), $('.actions'));
} }
$('.code').textContent = style.source; $('.code').textContent = style.source;
$('button.install').onclick = () => { $('button.install').onclick = () => {
@ -130,7 +130,7 @@ function initLiveReload(sourceLoader) {
if (oldWarning) { if (oldWarning) {
oldWarning.replaceWith(warning); oldWarning.replaceWith(warning);
} else { } else {
$('.main').prepend(warning); $('.main').insertBefore(warning, $('.main').childNodes[0]);
} }
}); });
}); });
@ -140,7 +140,7 @@ function initLiveReload(sourceLoader) {
watcher.start(); watcher.start();
} }
}); });
$('.actions').append(tHTML(` $('.actions').appendChild(tHTML(`
<label class="live-reload"> <label class="live-reload">
<input type="checkbox" class="live-reload-checkbox"> <input type="checkbox" class="live-reload-checkbox">
<span i18n-text="liveReloadLabel"></span> <span i18n-text="liveReloadLabel"></span>