tangled
alpha
login
or
join now
tokono.ma
/
diffuse
5
fork
atom
A music player that connects to your cloud/distributed storage.
5
fork
atom
overview
issues
4
pulls
pipelines
fix: focus
Steven Vandevelde
2 months ago
203ffd41
6d95f3fb
+7
-14
1 changed file
expand all
collapse all
unified
split
src
themes
webamp
window-manager
element.js
+7
-14
src/themes/webamp/window-manager/element.js
···
35
35
super.connectedCallback();
36
36
37
37
// Events
38
38
-
this.addEventListener("mousedown", this.focusOnWindow);
39
39
-
this.addEventListener("dtw-window-start-move", this.windowMoveStart);
38
38
+
this.root().addEventListener("mousedown", this.focusOnWindow);
39
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
60
-
this.removeEventListener("mousedown", this.focusOnWindow);
61
61
-
this.removeEventListener("dtw-window-start-move", this.windowMoveStart);
60
60
+
this.root().removeEventListener("mousedown", this.focusOnWindow);
61
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
92
-
this.setWindowZindex(win.id, this.#lastZindex)
92
92
+
win.style.zIndex = this.#lastZindex.toString();
93
93
}
94
94
}
95
95
···
153
153
154
154
/**
155
155
* @param {string} id
156
156
-
* @param {number} index
157
157
-
*/
158
158
-
setWindowZindex(id, index) {
159
159
-
const w = this.root().querySelector(`dtw-window#${id}`)
160
160
-
w.style.zIndex = index.toString();
161
161
-
}
162
162
-
163
163
-
/**
164
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
165
+
this.#lastZindex++;
166
166
+
w.style.zIndex = this.#lastZindex.toString();
174
167
}
175
168
}
176
169