Sha256: a3cd5c0592b41b8b854245aee23a99f087dfdcb74625163bb734d672d6a01c54
Contents?: true
Size: 1.65 KB
Versions: 41
Compression:
Stored size: 1.65 KB
Contents
// For the Ticket Details screen $(document).on('select2:select', '[data-event-registrant-user-search]', function(event) { var data = event.params.data['data']; var $form = $(event.currentTarget).closest('.event-registrant-user-fields') // Set the organization_id $form.find('input[type="hidden"][name$="[organization_id]"]').val(data.organization_id || '') $form.find('input[type="hidden"][name$="[organization_type]"]').val(data.organization_type || '') // Disable everything else $form.find('input[name$="[first_name]"]').val(data.first_name || '').prop('disabled', true) $form.find('input[name$="[last_name]"]').val(data.last_name || '').prop('disabled', true) $form.find('input[name$="[email]"]').val(data.email || '').prop('disabled', true) $form.find('select[name$="[organization_id]"]').val(data.organization_id || '').trigger('change').prop('disabled', true) $form.find('input[name$="[company]"]').val(data.company || '').prop('disabled', true) }); $(document).on('select2:unselect', '[data-event-registrant-user-search]', function(event) { var $form = $(event.currentTarget).closest('.event-registrant-user-fields') // Unset the organization_id $form.find('input[type="hidden"][name$="[organization_id]"]').val('') // Enable everything else $form.find('input[name$="[first_name]"]').val('').prop('disabled', false) $form.find('input[name$="[last_name]"]').val('').prop('disabled', false) $form.find('input[name$="[email]"]').val('').prop('disabled', false) $form.find('select[name$="[organization_id]"]').val('').trigger('change').prop('disabled', false) $form.find('input[name$="[company]"]').val('').prop('disabled', false) });
Version data entries
41 entries across 41 versions & 1 rubygems