From 60994df8d0d1b1482c106d6ae042b04abc9c7e42 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 1 Sep 2019 22:48:58 +0800 Subject: [PATCH] Conditionally disable port input field Disable port input when "Use different port on each startup" option is selected. This follows the behavior in GUI. --- src/webui/www/private/views/preferences.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/webui/www/private/views/preferences.html b/src/webui/www/private/views/preferences.html index 470a8e688..e999ab0aa 100644 --- a/src/webui/www/private/views/preferences.html +++ b/src/webui/www/private/views/preferences.html @@ -249,7 +249,7 @@
- +
@@ -1201,6 +1201,11 @@ }; // Connection tab + this.updatePortValueEnabled = function() { + const checked = $('random_port_checkbox').getProperty('checked'); + $('port_value').setProperty('disabled', checked); + }; + this.updateMaxConnecEnabled = function() { const isMaxConnecEnabled = $('max_connec_checkbox').getProperty('checked'); $('max_connec_value').setProperty('disabled', !isMaxConnecEnabled); @@ -1485,6 +1490,7 @@ $('port_value').setProperty('value', pref.listen_port.toInt()); $('upnp_checkbox').setProperty('checked', pref.upnp); $('random_port_checkbox').setProperty('checked', pref.random_port); + updatePortValueEnabled(); // Connections Limits const max_connec = pref.max_connec.toInt();