-
Notifications
You must be signed in to change notification settings - Fork 2
/
ident_switch-form.min.js
1 lines (1 loc) · 1.17 KB
/
ident_switch-form.min.js
1
$(function(){$("INPUT[name='_ident_switch.form.common.enabled']").change();plugin_switchIdent_processPreconfig()});function plugin_switchIdent_processPreconfig(){var a=$("INPUT[name='_ident_switch.form.common.readonly']");a.parentsUntil("TABLE","TR").hide();var b=a.val();if(b>0){$("INPUT[name='_ident_switch.form.imap.host']").prop("disabled",true);$("SELECT[name='_ident_switch.form.imap.tls']").prop("disabled",true);$("INPUT[name='_ident_switch.form.imap.port']").prop("disabled",true);$("INPUT[name='_ident_switch.form.smtp.host']").prop("disabled",true);$("SELECT[name='_ident_switch.form.smtp.tls']").prop("disabled",true);$("INPUT[name='_ident_switch.form.smtp.port']").prop("disabled",true)}if(2==b){$("INPUT[name='_ident_switch.form.imap.username']").prop("disabled",true);$("INPUT[name='_ident_switch.form.smtp.username']").prop("disabled",true)}}function plugin_switchIdent_enabled_onChange(a){var b=$("INPUT[name='_ident_switch.form.common.enabled'], INPUT[name='_ident_switch.form.imap.host'], INPUT[name='_ident_switch.form.smtp.host']");$("INPUT[name!='_ident_switch.form.common.enabled']",b.parents("FIELDSET")).prop("disabled",!b.is(":checked"));plugin_switchIdent_processPreconfig()};