Sha256: 43ada4d08b8164bcaaa9fd3ae59458f553ea7ec753e79833456e34ed3808cd49
Contents?: true
Size: 925 Bytes
Versions: 16
Compression:
Stored size: 925 Bytes
Contents
jQuery(function($) { $('.admin_users form.pageflow_invitation_form').each(function() { var quotaStateContainer = $('#quota_state_container', this); var accountSelect = $('#invitation_form_membership_entity_id', this); var fieldsets = $('#invitation_form_details', this).add('fieldset.actions', this); function updateQutaState() { var selectedAccountId = accountSelect.val(); $.get('/admin/users/quota_state?account_id=' + selectedAccountId) .done(function(html) { quotaStateContainer.html(html); updateForm(); }); } function updateForm() { if (quotaAvailable()) { fieldsets.show(); } else { fieldsets.hide(); } } function quotaAvailable() { return !!quotaStateContainer.find('[data-state=available]').length; } accountSelect.on('change', updateQutaState); updateForm(); }); });
Version data entries
16 entries across 16 versions & 1 rubygems