From f8dea00d8fd913e26e7b0cfff12149881ef33075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C5=BD=C3=A1ra?= Date: Fri, 12 Jun 2020 16:34:33 +0200 Subject: [PATCH] fixes --- app/cyp.js | 6 +++--- app/js/elements/library.js | 4 +--- app/js/elements/menu.js | 2 ++ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/cyp.js b/app/cyp.js index aecadc0..a96fefd 100644 --- a/app/cyp.js +++ b/app/cyp.js @@ -749,6 +749,8 @@ class Component extends HTMLElement { class Menu extends Component { connectedCallback() { + super.connectedCallback(); + /** @type HTMLElement[] */ this._tabs = Array.from(this.querySelectorAll("[data-for]")); @@ -1587,9 +1589,7 @@ const TAGS$1 = { function nonempty(str) { return (str.length > 0); } function createEnqueueCommand(node) { - if (node instanceof Song) { - return `add "${escape(node.data["file"])}"`; - } else if (node instanceof Path) { + if (node instanceof Song || node instanceof Path) { return `add "${escape(node.file)}"`; } else if (node instanceof Tag) { return [ diff --git a/app/js/elements/library.js b/app/js/elements/library.js index 6b2a83a..48ab7d3 100644 --- a/app/js/elements/library.js +++ b/app/js/elements/library.js @@ -17,9 +17,7 @@ const TAGS = { function nonempty(str) { return (str.length > 0); } function createEnqueueCommand(node) { - if (node instanceof Song) { - return `add "${escape(node.data["file"])}"`; - } else if (node instanceof Path) { + if (node instanceof Song || node instanceof Path) { return `add "${escape(node.file)}"`; } else if (node instanceof Tag) { return [ diff --git a/app/js/elements/menu.js b/app/js/elements/menu.js index 64f5a11..e4fe550 100644 --- a/app/js/elements/menu.js +++ b/app/js/elements/menu.js @@ -2,6 +2,8 @@ import Component from "../component.js"; class Menu extends Component { connectedCallback() { + super.connectedCallback(); + /** @type HTMLElement[] */ this._tabs = Array.from(this.querySelectorAll("[data-for]"));