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.
This commit is contained in:
Sunil Mohan Adapa 2017-01-29 11:02:59 +05:30
parent 31cad0bf40
commit e3d0c7ba80
No known key found for this signature in database
GPG Key ID: 36C361440C9BC971

View File

@ -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);