1ACC.returnorder = { 2 3 _autoload: [ 4 "returnReasonForm" 5 ], 6 7 returnReasonForm: function(){ 8 var timeout = null; 9 $('.js-update-entry-quantity-input').on('change paste keyup', function(){ 10 var returnQty = $(this).val(); 11 var thisForm = $(this).closest('.item__list--item').find('.return-reason-card'); 12 var formId = thisForm.attr('id'); 13 var itemIndex = formId[formId.length - 1]; 14 var step = $(this).data("step"); 15 var res= returnQty%step; 16 clearTimeout(timeout); 17 18 if ($('.item__list--item').length > 10){ 19 itemIndex = formId[formId.length -2] 20 }else if($('.item__list--item').length > 100){ 21 itemIndex = formId[formId.length -3] 22 } 23 24 var qtybought = parseInt($('#item_quantity_' + itemIndex).attr("value")); 25 if (returnQty > 0){ 26 thisForm.show(); 27 }else{ 28 thisForm.hide(); 29 } 30 31 timeout = setTimeout(function () { 32 if (res !=0 ){ 33 $('#returnEntryQuantityMap' + itemIndex).val(step); 34 } 35 }, 500); 36 37 if (returnQty > qtybought){ 38 $('#returnEntryQuantityMap' + itemIndex).val(qtybought); 39 } 40 41 thisForm.find('.checkbox > input').on('change', function() { 42 thisForm.find('.checkbox > input').not(this).prop('checked', false); 43 44 if ($('#other' + itemIndex).is(':checked')){ 45 thisForm.find('textarea').show().attr('required', true); 46 }else{ 47 thisForm.find('textarea').hide().attr('required', false); 48 } 49 50 }); 51 52 thisForm.find('#saveReturnReason' + itemIndex).click(function(){ 53 54 if (thisForm.find('.checkbox > input:checked').length < 1){ 55 thisForm.find('.return-warning').html("Por favor, selecciona un motivo de devolución."); 56 }else if (thisForm.find('#other' + itemIndex).is(':checked') && (thisForm.find('textarea').val() == '' )){ 57 thisForm.find('.return-warning').hide(); 58 thisForm.find('.return-warning--textarea').html("Por favor, explica el motivo de la devolución."); 59 }else{ 60 thisForm.find('.return-warning--textarea').hide(); 61 thisForm.hide(); 62 $("#returnOrderButtonConfirmation").prop("disabled", false); 63 } 64 }); 65}); 66 67 } 68 69}
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.