Skip to content

Commit e99a616

Browse files
Solve "transfer-complete" and "receive-complete" status detection via css instead of adding a new class
1 parent 15ace16 commit e99a616

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

public/scripts/ui.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -807,16 +807,11 @@ class PeerUI {
807807
this.$el.querySelector('.status').innerText = statusName;
808808
this._currentStatus = status;
809809

810-
if (status === "transfer-complete" || status === "receive-complete") {
811-
this.$el.classList.remove('blink');
812-
810+
if (status.indexOf("-complete") || status === "receive-complete") {
813811
this.statusTimeout = setTimeout(() => {
814812
this.setProgress(0, null);
815813
}, 10000);
816814
}
817-
else {
818-
this.$el.classList.add('blink');
819-
}
820815
}
821816

822817
_onDrop(e) {

public/styles/styles-deferred.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@ x-peer:not(.type-public-id) .highlight-room-public-id {
188188
display: none;
189189
}
190190

191-
x-peer:not([status].blink):hover,
192-
x-peer:not([status].blink):focus {
191+
x-peer:is(:not([status]), [status$=-complete]):hover,
192+
x-peer:is(:not([status]), [status$=-complete]):focus {
193193
transform: scale(1.05);
194194
}
195195

196-
x-peer[status].blink x-icon {
196+
x-peer[status]:not([status$=-complete]) x-icon {
197197
box-shadow: none;
198198
}
199199

@@ -249,15 +249,15 @@ x-peer[status] .device-name {
249249
display: none;
250250
}
251251

252-
x-peer[status].blink {
252+
x-peer[status]:not([status$=-complete]) {
253253
pointer-events: none;
254254
}
255255

256256
x-peer {
257257
animation: pop 600ms ease-out 1;
258258
}
259259

260-
x-peer[status]:not(.blink) .status {
260+
x-peer[status$=-complete] .status {
261261
color: var(--primary-color);
262262
}
263263

0 commit comments

Comments
 (0)