1require.config({ 2 deps: [ 3 'jquery' 4 ], 5 callback: function ($) { 6 'use strict'; 7 8 /*var radioButtons = '<input type="radio" class="radio admin__control-radio required product-custom-option" name="options[28988]" id="options28988_1" value="yes" data-selector="options[28988]" price="0" aria-required="true"> Yes' + 9 '<input type="radio" class="radio admin__control-radio required product-custom-option" name="options[28988]" id="options28988_2" value="no" data-selector="options[28988]" price="0" aria-required="true" style="margin-left:10px"> No'; 10 //$("#options_28988_text").before(radioButtons); 11 12 // Initially hide the textarea 13 //$("#options_28988_text").hide(); 14 15 // Show/hide textarea based on radio button selection 16 $('input[name="options[28988]"]').change(function() { 17 if ($(this).val() == "yes") { 18 $("#options_28988_text").show(); 19 } else { 20 $("#options_28988_text").hide(); 21 } 22 });*/ 23 24 $('.field.textarea').has('[data-price-amount]').each(function() { 25 var $textarea = $(this).find('textarea.product-custom-option'); 26 27 // Insert radio buttons before the textarea 28 /*$('<input type="radio" name="' + $textarea.attr('id') + '_add_character" value="yes">Yes<input type="radio" name="' + $textarea.attr('id') + '_add_character" value="no" style="margin-left:10px">No').insertBefore($textarea);*/ 29 var radioButtonsHtml = '<input type="radio" name="' + $textarea.attr('id') + '_add_character" value="yes" id="' + $textarea.attr('id') + '_yes"><label for="' + $textarea.attr('id') + '_yes">Yes</label>'; 30 radioButtonsHtml += '<input type="radio" name="' + $textarea.attr('id') + '_add_character" style="margin-left:10px" value="no" id="' + $textarea.attr('id') + '_no"><label for="' + $textarea.attr('id') + '_no">No</label>'; 31 $(radioButtonsHtml).insertBefore($textarea); 32 33 // Initially hide the textarea 34 $textarea.hide(); 35 36 // Show/hide textarea based on radio button selection 37 $('input[name="' + $textarea.attr('id') + '_add_character"]').change(function() { 38 if ($(this).val() === 'yes') { 39 $textarea.show(); 40 } else { 41 $textarea.hide(); 42 } 43 }); 44 }); 45 46 47 48 $('.menu-area .navbar-toggler').on('click', function(e) { 49 $(this).next().slideToggle(); 50 51 return false; 52 }); 53 } 54});
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.