Load site settings from dotenv and store OAuth credentials
This commit is contained in:
@@ -9,15 +9,20 @@ jQuery(function ($) {
|
||||
});
|
||||
$('[data-provider-settings]').each(function () {
|
||||
const $settings = $(this);
|
||||
const $preset = $settings.closest('form').find('[data-layout-preset]');
|
||||
const $form = $settings.closest('form');
|
||||
const $preset = $form.find('[data-layout-preset]');
|
||||
const $account = $form.find('[name="components[]"][value=account]');
|
||||
const $mode = $settings.find('[name=provider_mode]');
|
||||
const sync = () => {
|
||||
$settings.prop('hidden', $preset.val() !== 'member');
|
||||
const mode = $mode.val();
|
||||
const active = $preset.val() === 'member' && $account.is(':checked');
|
||||
$settings.prop({hidden: !active, disabled: !active});
|
||||
$settings.find('[data-provider-field]').prop('hidden', !mode);
|
||||
$settings.find('[data-provider-mode]').each(function () {
|
||||
$(this).prop('hidden', this.dataset.providerMode !== $mode.val());
|
||||
$(this).prop('hidden', this.dataset.providerMode !== mode);
|
||||
});
|
||||
};
|
||||
$preset.add($mode).on('change', sync);
|
||||
$preset.add($mode).add($account).on('change', sync);
|
||||
sync();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user