fix: when comparing priority for rpc call, cast to string first (#4610)
This commit is contained in:
parent
b5c9e3d697
commit
506439f099
|
@ -513,11 +513,6 @@ $video-image: '../img/film.svg';
|
|||
&.selected {
|
||||
background-color: var(--color-bg-selected);
|
||||
}
|
||||
|
||||
&.selected .torrent-progress-details.error,
|
||||
&.selected .torrent-peer-details.error {
|
||||
color: $white;
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
|
@ -1189,7 +1184,7 @@ $video-image: '../img/film.svg';
|
|||
|
||||
> * {
|
||||
appearance: none;
|
||||
background-color: var(--color-bg-primary);
|
||||
background-color: var(--color-border-selected);
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: $halfsize, $size;
|
||||
|
@ -1214,9 +1209,9 @@ $video-image: '../img/film.svg';
|
|||
border-left-width: 0;
|
||||
}
|
||||
|
||||
//if input is not checked, change background color
|
||||
> *:not(:checked) {
|
||||
background-color: var(--color-border-selected);
|
||||
//if input is checked then change the background color
|
||||
> .checked {
|
||||
background-color: var(--color-bg-hover);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,12 @@
|
|||
License text can be found in the licenses/ folder. */
|
||||
|
||||
import { Formatter } from './formatter.js';
|
||||
import { makeUUID, setChecked, setEnabled, setTextContent } from './utils.js';
|
||||
import {
|
||||
addCheckedClass,
|
||||
makeUUID,
|
||||
setEnabled,
|
||||
setTextContent,
|
||||
} from './utils.js';
|
||||
|
||||
export class FileRow extends EventTarget {
|
||||
isDone() {
|
||||
|
@ -48,11 +53,11 @@ export class FileRow extends EventTarget {
|
|||
have += file.bytesCompleted;
|
||||
size += file.length;
|
||||
wanted |= file.wanted;
|
||||
switch (file.priority) {
|
||||
case -1:
|
||||
switch (file.priority.toString()) {
|
||||
case '-1':
|
||||
low = true;
|
||||
break;
|
||||
case 1:
|
||||
case '1':
|
||||
high = true;
|
||||
break;
|
||||
default:
|
||||
|
@ -61,9 +66,9 @@ export class FileRow extends EventTarget {
|
|||
}
|
||||
}
|
||||
|
||||
setChecked(this.elements.priority_low_button, low);
|
||||
setChecked(this.elements.priority_normal_button, normal);
|
||||
setChecked(this.elements.priority_high_button, high);
|
||||
addCheckedClass(this.elements.priority_low_button, low);
|
||||
addCheckedClass(this.elements.priority_normal_button, normal);
|
||||
addCheckedClass(this.elements.priority_high_button, high);
|
||||
|
||||
if (this.fields.have !== have || this.fields.size !== size) {
|
||||
this.fields.have = have;
|
||||
|
@ -132,7 +137,7 @@ export class FileRow extends EventTarget {
|
|||
|
||||
e = document.createElement('input');
|
||||
e.type = 'radio';
|
||||
e.value = -1;
|
||||
e.value = '-1';
|
||||
e.className = 'low';
|
||||
e.title = 'Low Priority';
|
||||
e.addEventListener('click', priority_click_listener);
|
||||
|
@ -141,7 +146,7 @@ export class FileRow extends EventTarget {
|
|||
|
||||
e = document.createElement('input');
|
||||
e.type = 'radio';
|
||||
e.value = 0;
|
||||
e.value = '0';
|
||||
e.className = 'normal';
|
||||
e.title = 'Normal Priority';
|
||||
e.addEventListener('click', priority_click_listener);
|
||||
|
@ -150,7 +155,7 @@ export class FileRow extends EventTarget {
|
|||
|
||||
e = document.createElement('input');
|
||||
e.type = 'radio';
|
||||
e.value = 1;
|
||||
e.value = '1';
|
||||
e.title = 'High Priority';
|
||||
e.className = 'high';
|
||||
e.addEventListener('click', priority_click_listener);
|
||||
|
|
|
@ -825,11 +825,11 @@ export class Inspector extends EventTarget {
|
|||
const { indices, priority } = event_;
|
||||
|
||||
let command = null;
|
||||
switch (priority) {
|
||||
case -1:
|
||||
switch (priority.toString()) {
|
||||
case '-1':
|
||||
command = 'priority-low';
|
||||
break;
|
||||
case 1:
|
||||
case '1':
|
||||
command = 'priority-high';
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -268,6 +268,10 @@ export function setChecked(element, b) {
|
|||
setOrDeleteAttribute(element, 'checked', b);
|
||||
}
|
||||
|
||||
export function addCheckedClass(element, b) {
|
||||
element.classList.toggle('checked', b);
|
||||
}
|
||||
|
||||
function getBestMenuPos(r, bounds) {
|
||||
let { x, y } = r;
|
||||
const { width, height } = r;
|
||||
|
|
Loading…
Reference in New Issue