1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-16 10:06:54 +00:00

node.remove() exists, so why have I been doing node.parentElement.removeChild(node). I am literally the worst.

This commit is contained in:
SirStendec 2017-12-01 15:36:18 -05:00
parent ddee1e3bb5
commit fcc3cab35f
9 changed files with 10 additions and 15 deletions

View file

@ -28,7 +28,7 @@ export default {
const btn = container.querySelector('#ffz-old-news-button');
if ( btn )
btn.addEventListener('click', () => {
btn.parentElement.removeChild(btn);
btn.remove();
const old_news = container.querySelector('#ffz-old-news');
if ( old_news )
this.fetch(`${SERVER}/script/old_changes.html`, old_news);

View file

@ -89,7 +89,7 @@ export default {
async: true,
charset: 'utf-8',
src: 'https://platform.twitter.com/widgets.js',
onLoad: () => el.parentElement.removeChild(el)
onLoad: () => el.remove()
}));
}

View file

@ -121,7 +121,7 @@ export default class MainMenu extends Module {
main.classList.remove('ffz-has-menu');
if ( this._menu ) {
main.removeChild(this._menu);
this._menu.remove();
this._vue.$destroy();
this._menu = this._vue = null;
}
@ -151,7 +151,7 @@ export default class MainMenu extends Module {
else
old_main.classList.remove('ffz-has-menu');
old_main.removeChild(this._menu);
this._menu.remove();
main.appendChild(this._menu);
this._vue.$children[0].maximized = maximized;

View file

@ -240,7 +240,7 @@ export default class Metadata extends Module {
el.popper.destroy();
el.tooltip = el.popper = null;
el.parentElement.removeChild(el);
el.remove();
}
};

View file

@ -243,7 +243,7 @@ export default class Scroller extends Module {
this._ffz_freeze_visible = false;
if ( this._ffz_freeze_indicator ) {
node.removeChild(this._ffz_freeze_indicator);
this._ffz_freeze_indicator.remove();
this._ffz_freeze_indicator = null;
}

View file

@ -106,7 +106,7 @@ export default class MenuButton extends SiteModule {
this.off('i18n:update', this.onTranslate);
if ( this._el )
this._el.parentElement.removeChild(this._el);
this._el.remove();
this._pill = this._tip = this._el = null;
}

View file

@ -64,10 +64,8 @@ export default class ThemeEngine extends Module {
});
} else if ( ! enable ) {
if ( this._style.parentElement === document.head )
document.head.removeChild(this._style);
this._style.remove();
return;
}
document.head.appendChild(this._style);

View file

@ -126,7 +126,7 @@ export class ManagedStyle {
}
destroy() {
document.head.removeChild(this._style);
this._style.remove();
this._blocks = null;
this._style = null;
}

View file

@ -291,10 +291,7 @@ export class Tooltip {
}
if ( tip.outer ) {
const o = tip.outer;
if ( o.parentElement )
o.parentElement.removeChild(o);
tip.outer.remove();
tip.outer = null;
}