Sha256: ee4e369a61bd6c67512667363f860549707ea6cc689e778fdeb0f09c71877766
Contents?: true
Size: 1.05 KB
Versions: 18
Compression:
Stored size: 1.05 KB
Contents
jQuery(function($) { $('.admin_accounts').filter('.new, .edit').find('form.pageflow_account').each(function() { var themeSelect = $('#account_paged_entry_template_attributes_theme_name', this); var themeOptions = JSON.parse($('script#theme_options', this).text()); var homeButtonCheckBox = $('#account_paged_entry_template_attributes_configuration_home_button_enabled', this); updateThemeFeatures(); themeSelect.on('change', updateThemeFeatures); function updateThemeFeatures() { toggleDisabled(homeButtonCheckBox, !selectedThemeSupportsHomeButton()); } function selectedThemeSupportsHomeButton() { return !themeOptions[themeSelect.val()].no_home_button; } function toggleDisabled(checkBox, disabled) { if (disabled) { checkBox.data('wasChecked', checkBox.is(':checked')); checkBox.prop('checked', false); checkBox.prop('disabled', true); } else { checkBox.removeAttr('disabled'); checkBox.prop('checked', checkBox.data('wasChecked')); } } }); });
Version data entries
18 entries across 18 versions & 1 rubygems