mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 16:23:07 -07:00
Fix alternative speed limits toggle behavior
This commit is contained in:
parent
135599acc4
commit
0f56440dec
2 changed files with 7 additions and 10 deletions
|
@ -222,6 +222,11 @@ window.addEvent('load', function () {
|
|||
$('queueingMenuItems').addClass('invisible');
|
||||
}
|
||||
}
|
||||
|
||||
if (alternativeSpeedLimits != serverState.use_alt_speed_limits) {
|
||||
alternativeSpeedLimits = serverState.use_alt_speed_limits;
|
||||
updateAltSpeedIcon(alternativeSpeedLimits);
|
||||
}
|
||||
};
|
||||
|
||||
var updateAltSpeedIcon = function(enabled) {
|
||||
|
@ -231,16 +236,6 @@ window.addEvent('load', function () {
|
|||
$('alternativeSpeedLimits').src = "images/slow_off.png"
|
||||
}
|
||||
|
||||
// Determine whether the alternative speed limits are enabled or not
|
||||
new Request({url: 'command/alternativeSpeedLimitsEnabled',
|
||||
method: 'get',
|
||||
onSuccess : function (isEnabled) {
|
||||
alternativeSpeedLimits = !!parseInt(isEnabled);
|
||||
if (alternativeSpeedLimits)
|
||||
$('alternativeSpeedLimits').src = "images/slow.png"
|
||||
}
|
||||
}).send();
|
||||
|
||||
$('alternativeSpeedLimits').addEvent('click', function() {
|
||||
// Change icon immediately to give some feedback
|
||||
updateAltSpeedIcon(!alternativeSpeedLimits);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue