1(function ($) { 2 "use strict"; 3 4 $(window).on('load', function(){attendee_checkbox_check();}); 5 6 $(document).on('click', '[name="mp_form_builder_same_attendee"]', function () { 7 attendee_info_copy($(this)); 8 }); 9 $(document).on('change', '.dada-info input:visible,.dada-info select:visible,.dada-info textarea:visible', function () { 10 let target=$(this).closest('.mep-user-info-sec').find('[name="mp_form_builder_same_attendee"]'); 11 if(target.length>0 && target.is(":checked")){ 12 let parent = $(this).closest('.dada-info'); 13 change_attendee_info($(this),parent); 14 } 15 }); 16 $(document).on('click', '#mage_event_submit .qty_inc', function () { 17 let target=$(this).closest('tr').next().find('[name="mp_form_builder_same_attendee"]'); 18 if(target.length>0){ 19 attendee_info_copy(target); 20 } 21 }); 22 $(document).on('change', '#mage_event_submit [name="option_qty[]"]', function () { 23 let target=$(this).closest('tr').next().find('[name="mp_form_builder_same_attendee"]'); 24 if(target.length>0){ 25 attendee_info_copy(target); 26 }else { 27 let same_attendee=$('[name="mep_enable_same_attendee"]').val(); 28 let checked=same_attendee==='must'?'checked':''; 29 $(this).closest('tr').next().find('.dada-info>div:first-child .mep-user-info-sec h5').append('<label class="mep_same_attendee"><input '+checked+' type="checkbox" name="mp_form_builder_same_attendee" /><span>Same Attendee.</span></label>'); 30 } 31 }); 32 33 function attendee_checkbox_check() { 34 $('#mage_event_submit').find('.user-info-sec').each(function () { 35 if ($(this).find('[name="mp_form_builder_same_attendee"]').length < 1) { 36 let same_attendee=$('[name="mep_enable_same_attendee"]').val(); 37 let checked=same_attendee==='must'?'checked':''; 38 $(this).find('.dada-info>div:first-child .mep-user-info-sec h5').append('<label><input '+checked+' type="checkbox" name="mp_form_builder_same_attendee" /><span>Same Attendee</span></label>'); 39 } 40 }); 41 } 42 function attendee_info_copy($this){ 43 if ($this.is(":checked")) { 44 $this.closest('tr').find('.dada-info>div:not(:first-child)').slideUp(250); 45 let parent = $this.closest('.dada-info'); 46 let current_parent = $this.closest('.mep-user-info-sec'); 47 current_parent.find('input:visible , select:visible , textarea:visible').each(function () { 48 change_attendee_info($(this),parent); 49 }); 50 } else { 51 $this.closest('.user-info-sec').find('.dada-info>div:not(:first-child)').slideDown(250); 52 } 53 } 54 function change_attendee_info($this,parent){ 55 let input_name = $this.attr('name'); 56 let value = $this.val(); 57 parent.find('[name="' + input_name + '"]').each(function () { 58 if ($(this).is('select')) { 59 $(this).find('option[value='+value+']').attr('selected', true); 60 } else { 61 $(this).val(value); 62 } 63 }); 64 } 65 66}(jQuery));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.