From e3d0c7ba801ba30bd0bc3d402a3a323291d9b962 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 29 Jan 2017 11:02:59 +0530 Subject: [PATCH] tor: Update upstream bridges javascript actions - Always show relay and bridge relay options. This is show to the users that the options are available but not enabled because of somethings else. Otherwise, users may not be able to discover these important options. - Simplify animation for upstream bridges text box. --- plinth/modules/tor/templates/tor.html | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/plinth/modules/tor/templates/tor.html b/plinth/modules/tor/templates/tor.html index ff881b086..2bd0be414 100644 --- a/plinth/modules/tor/templates/tor.html +++ b/plinth/modules/tor/templates/tor.html @@ -154,19 +154,14 @@ $('#id_tor-use_upstream_bridges').change(function() { if ($('#id_tor-use_upstream_bridges').prop('checked')) { - $('#id_tor-upstream_bridges').show('slow'); - $('label[for="id_tor-upstream_bridges"]').show('slow'); - $('label[for="id_tor-upstream_bridges"]').parent().show('slow'); - $('#id_tor-relay_enabled').prop('checked', false); - $('#id_tor-bridge_relay_enabled').prop('checked', false); - $('#id_tor-relay_enabled').parent().parent().parent().parent().hide('slow'); - $('#id_tor-bridge_relay_enabled').parent().parent().parent().parent().hide('slow'); + $('#id_tor-upstream_bridges').parent().parent().show('slow'); + $('#id_tor-relay_enabled').prop('checked', false) + .prop('disabled', true); + $('#id_tor-bridge_relay_enabled').prop('checked', false) + .prop('disabled', true); } else { - $('#id_tor-upstream_bridges').hide('slow'); - $('label[for="id_tor-upstream_bridges"]').hide('slow'); - $('label[for="id_tor-upstream_bridges"]').parent().hide('slow'); - $('#id_tor-relay_enabled').parent().parent().parent().parent().show('slow'); - $('#id_tor-bridge_relay_enabled').parent().parent().parent().parent().show('slow'); + $('#id_tor-upstream_bridges').parent().parent().hide('slow'); + $('#id_tor-relay_enabled').prop('disabled', false); } }).change(); })(jQuery);