mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 06:28:03 -06:00
Fix alternative speed limits toggle behavior
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user