1(function ($) { 2 var p_f_height; 3 var is_collapse = true; 4 var show_row = 2; 5 var me = function (element, row, is_collapse) { 6 var p, c, c_height, init_height; 7 if (is_collapse) { 8 p = $(element); 9 p_f_height = p.height(); 10 c = p.children(); 11 if (c.length > 0) { 12 c_height = c.height(); 13 row = parseInt(row); 14 // Is Mobile 15 if ($(window).width() <= 425) { 16 row = row + 3; 17 } 18 init_height = row * c_height; 19 p.height(init_height); 20 } 21 } 22 } 23 var expand_section = function (e) { 24 var ele = $('.mep-event-attendee--inner'); 25 is_collapse = !is_collapse; 26 if (is_collapse) { 27 me('.mep-event-attendee--inner', show_row, is_collapse); 28 $(e).text('See all'); 29 } else { 30 ele.height(p_f_height); 31 $(e).text('See less'); 32 } 33 } 34 $('#attendee--see-all').on('click', function () { 35 expand_section($(this)); 36 }); 37 38 // init 39 // me('.mep-event-attendee--inner', show_row, is_collapse); 40 41 $(document).on('click', '[data-radio]', function () { 42 let target = $(this).closest('label'); 43 let value = $(this).attr('data-radio'); 44 target.find('.customRadio').removeClass('active'); 45 $(this).addClass('active'); 46 target.find('input').val(value).trigger('change'); 47 }); 48 49 $(document).on('click', '#mage_event_submit .customCheckboxLabel', function () { 50 let parent = $(this).closest('.customCheckBoxArea'); 51 let value = ''; 52 let separator = ','; 53 parent.find(' input[type="checkbox"]').each(function () { 54 if ($(this).is(":checked")) { 55 let currentValue = $(this).attr('data-checked'); 56 value = value + (value ? separator : '') + currentValue; 57 } 58 }).promise().done(function () { 59 parent.find('input[type="text"]').val(value); 60 }); 61 }); 62 63 // $(document).on('DOMSubtreeModified', '#mage_event_submit #ttyttl', function () { 64 // setTimeout(function () { 65 // if (parseInt($('#ttyttl').html()) > 0) { 66 // $('label.term_condition_area').slideDown(250); 67 // } else { 68 // $('label.term_condition_area').slideUp(250); 69 // } 70 // }, 1000); 71 // }); 72 73 /************File Upload*************/ 74 $(document).on('click', '#mage_event_submit .attach_file_area .attach_file_view', function () { 75 let parent = $(this).closest('.attach_file_area'); 76 parent.find('input[type="file"]').trigger('click'); 77 }); 78 $(document).on('change', '#mage_event_submit .attach_file_area input[type="file"]', function (e) { 79 let parent = $(this).closest('.attach_file_area'); 80 let input = this; 81 let url = input.value; 82 let ext = url.substring(url.lastIndexOf('.') + 1).toLowerCase(); 83 if (input.files && input.files[0] && (ext === "gif" || ext === "png" || ext === "jpg" || ext === "pdf")) { 84 if (input.files[0].size <= 1024000) { 85 let reader = new FileReader(); 86 reader.onload = function (e) { 87 if (ext === "pdf") { 88 parent.find('.attach_file_view img').slideUp(250);
89 parent.find('.attach_file_view span').slideUp(250); 90 parent.find('.attach_file_view iframe').attr('src', e.target.result).slideDown(250); 91 } else { 92 parent.find('.attach_file_view iframe').slideUp(250); 93 parent.find('.attach_file_view span').slideUp(250); 94 parent.find('.attach_file_view img').attr('src', e.target.result).slideDown(250); 95 } 96 } 97 reader.readAsDataURL(input.files[0]); 98 } else { 99 alert('Maximum size 1MB'); 100 parent.find('.attach_file_view img').slideUp(250); 101 parent.find('.attach_file_view span').slideDown(250); 102 parent.find('.attach_file_view iframe').slideUp(250); 103 $(this).val(''); 104 } 105 } else { 106 parent.find('.attach_file_view img').slideUp(250); 107 parent.find('.attach_file_view span').slideDown(250); 108 parent.find('.attach_file_view iframe').slideUp(250); 109 $(this).val(''); 110 } 111 }); 112 /************conditional form*************/ 113 $(document).on('change', '.mep-user-info-sec [data-target-condition-id]', function (e) { 114 //e.stopPropagation(); 115 let child_id = $(this).find('option:selected').attr('data-target-child-id'); 116 let parent = $(this).closest('.mep-user-info-sec'); 117 $(this).find('option').each(function () { 118 let child_id_hidden = $(this).attr('data-target-child-id'); 119 if (child_id_hidden) { 120 if (child_id === child_id_hidden) { 121 parent.find('[data-condition-id="' + child_id_hidden + '"]').removeClass('mep-hidden'); 122 } else { 123 parent.find('[data-condition-id="' + child_id_hidden + '"]').addClass('mep-hidden'); 124 } 125 } 126 }); 127 }); 128 $(document).on('change', '#mage_event_submit [name="option_qty[]"]', function () { 129 let parent = $(this).closest('#mage_event_submit'); 130 parent.find('[name="ticket_type[]"]').each(function () { 131 let ticket_name = $(this).val(); 132 if (ticket_name) { 133 let current_parent = $(this).closest('.mep-user-info-sec'); 134 current_parent.find('[data-condition-id="' + ticket_name + '"]').removeClass('mep-hidden'); 135 } 136 }); 137 }); 138})(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.