A music player that connects to your cloud/distributed storage.

fix: focus

+7 -14
+7 -14
src/themes/webamp/window-manager/element.js
··· 35 35 super.connectedCallback(); 36 36 37 37 // Events 38 - this.addEventListener("mousedown", this.focusOnWindow); 39 - this.addEventListener("dtw-window-start-move", this.windowMoveStart); 38 + this.root().addEventListener("mousedown", this.focusOnWindow); 39 + this.root().addEventListener("dtw-window-start-move", this.windowMoveStart); 40 40 41 41 // Webamp stuff 42 42 document.body.addEventListener( ··· 57 57 disconnectedCallback() { 58 58 super.disconnectedCallback(); 59 59 60 - this.removeEventListener("mousedown", this.focusOnWindow); 61 - this.removeEventListener("dtw-window-start-move", this.windowMoveStart); 60 + this.root().removeEventListener("mousedown", this.focusOnWindow); 61 + this.root().removeEventListener("dtw-window-start-move", this.windowMoveStart); 62 62 63 63 document.body.removeEventListener( 64 64 "mousedown", ··· 89 89 if (win.id) this.$activeWindow.value = win.id; 90 90 91 91 this.#lastZindex++; 92 - this.setWindowZindex(win.id, this.#lastZindex) 92 + win.style.zIndex = this.#lastZindex.toString(); 93 93 } 94 94 } 95 95 ··· 153 153 154 154 /** 155 155 * @param {string} id 156 - * @param {number} index 157 - */ 158 - setWindowZindex(id, index) { 159 - const w = this.root().querySelector(`dtw-window#${id}`) 160 - w.style.zIndex = index.toString(); 161 - } 162 - 163 - /** 164 - * @param {string} id 165 156 */ 166 157 toggleWindow(id) { 167 158 const w = this.root().querySelector(`dtw-window#${id}`) ··· 171 162 172 163 if (w.hasAttribute("open")) { 173 164 this.activateWindow(id) 165 + this.#lastZindex++; 166 + w.style.zIndex = this.#lastZindex.toString(); 174 167 } 175 168 } 176 169