WebUI: migrate away from MooTools deprecated functions

https://mootools.net/core/docs/1.6.0/Core/Core#Deprecated-Functions
This commit is contained in:
Chocobo1
2024-04-21 15:32:36 +08:00
parent 4945ed576a
commit 1c7ecb7371
3 changed files with 10 additions and 15 deletions

View File

@@ -44,7 +44,7 @@ window.qBittorrent.ProgressBar = (function() {
initialize: function(value, parameters) {
const vals = {
'id': 'progressbar_' + (ProgressBars++),
'value': $pick(value, 0),
'value': [value, 0].pick(),
'width': 0,
'height': 0,
'darkbg': 'var(--color-background-blue)',
@@ -52,8 +52,8 @@ window.qBittorrent.ProgressBar = (function() {
'lightbg': 'var(--color-background-default)',
'lightfg': 'var(--color-text-default)'
};
if (parameters && ($type(parameters) === 'object'))
$extend(vals, parameters);
if (parameters && (typeOf(parameters) === 'object'))
Object.append(vals, parameters);
if (vals.height < 12)
vals.height = 12;
const obj = new Element('div', {
@@ -68,7 +68,7 @@ window.qBittorrent.ProgressBar = (function() {
}
});
obj.vals = vals;
obj.vals.value = $pick(value, 0); // Fix by Chris
obj.vals.value = [value, 0].pick();
obj.vals.dark = new Element('div', {
'id': vals.id + '_dark',
'class': 'progressbar_dark',