From 63946c3d0034acfdcb3b936256662d5f36b997b6 Mon Sep 17 00:00:00 2001 From: Roman Almazov Date: Fri, 26 Jul 2019 11:09:59 +0300 Subject: [PATCH] Rework --- src/renderer/App.vue | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/renderer/App.vue b/src/renderer/App.vue index 33ed75c..2ac7d7e 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -331,6 +331,7 @@ mounted() { this.loadSong(); this.time = new Date(); + // @TODO add if network error clearInterval and handle it setInterval(() => this.loadSong(), 1000); }, @@ -433,6 +434,39 @@ this.loadSong(); } } +/* + let elmIndex; + let elm = this.source.find((element, index, array) => element.id == id); + if (moveTo) { + let res = Number(i) + 1; + if (res > this.source.length - 1) { + this.current = this.source[0].id; + this.channelGif = this.source[0].background; + let uiScroll = this.selector('ul-scroll'); + let topPos = uiScroll.offsetTop; + this.selector('wrap-scroll').scrollTop = topPos; + } else { + this.current = this.source[res].id; + this.channelGif = this.source[res].background; + } + } else { + let res = Number(i) - 1; + if (res < 0) { + this.current = this.source[Number(this.source.length) - 1].id; + this.channelGif = this.source[Number(this.source.length) - 1].background; + + let uiScroll = this.selector('ul-scroll'); + let topPos = uiScroll.offsetTop; + let wrapScroll = this.selector('wrap-scroll'); + wrapScroll.scrollTop = wrapScroll.scrollHeight; + } else { + this.current = this.source[res].id; + this.channelGif = this.source[res].background; + } + } + this.refresh(); + this.loadSong(); + */ }, madeFavorite(id) {