$(document).ready(function() { function bindElRemoveBooks(){ $(document).off('click.removeBooks').on('click.removeBooks', '.js-remove-book', function() { let $page_type = $(this).data('page-type'); removeBook($(this), true, $page_type); }); } function bindChangeDestinationBook(){ $(document).off('change.destBooks').on('change.destBooks', '.js-destinations-books', function() { changeDestinationBook($(this)); }); } function checkout_step_1_books(){ $(document).off('click.checkout1').on('click.checkout1', '#js-checkout-step-1-books', function() { if(!JSON.parse($(this).attr('data-disabled'))) { toogleWaitingOn(0.2); is_address_in_blacklist_books(); } }); } function checkout_step_2_books(){ $(document).off('click.checkout2').on('click.checkout2', '#js-checkoout-step-2-books', function() { checkoutStep2Books($(this)); }); } bindElRemoveBooks(); bindChangeDestinationBook(); checkout_step_1_books(); checkout_step_2_books(); });