app/assets/javascripts/spree/backend/shipments.js.erb in spree_backend-2.3.3 vs app/assets/javascripts/spree/backend/shipments.js.erb in spree_backend-2.3.4

- old
+ new

@@ -45,19 +45,20 @@ adjustShipmentItems(shipment_number, variant_id, quantity); return false; }); //handle delete click - $('a.delete-item').click(function(){ + $('a.delete-item').click(function(event){ if (confirm(Spree.translations.are_you_sure_delete)) { var del = $(this); var shipment_number = del.data('shipment-number'); var variant_id = del.data('variant-id'); toggleItemEdit(); adjustShipmentItems(shipment_number, variant_id, 0); } + return false; }); // handle ship click $('[data-hook=admin_shipment_form] a.ship').on('click', function () { var link = $(this); @@ -76,11 +77,13 @@ // handle shipping method edit click $('a.edit-method').click(toggleMethodEdit); $('a.cancel-method').click(toggleMethodEdit); // handle shipping method save - $('[data-hook=admin_shipment_form] a.save-method').on('click', function () { + $('[data-hook=admin_shipment_form] a.save-method').on('click', function (event) { + event.preventDefault(); + var link = $(this); var shipment_number = link.data('shipment-number'); var selected_shipping_rate_id = link.parents('tbody').find("select#selected_shipping_rate_id[data-shipment-number='" + shipment_number + "']").val(); var unlock = link.parents('tbody').find("input[name='open_adjustment'][data-shipment-number='" + shipment_number + "']:checked").val(); var url = Spree.url(Spree.routes.shipments_api + '/' + shipment_number + '.json'); @@ -169,10 +172,12 @@ toggleMethodEdit = function(){ var link = $(this); link.parents('tbody').find('tr.edit-method').toggle(); link.parents('tbody').find('tr.show-method').toggle(); + + return false; } toggleItemEdit = function(){ var link = $(this); link.parent().find('a.edit-item').toggle(); @@ -290,10 +295,12 @@ prev_row.find('a.edit-item').toggle(); prev_row.find('a.split-item').toggle(); prev_row.find('a.delete-item').toggle(); } -addVariantFromStockLocation = function() { +addVariantFromStockLocation = function(event) { + event.preventDefault(); + $('#stock_details').hide(); var variant_id = $('input.variant_autocomplete').val(); var stock_location_id = $(this).data('stock-location-id'); var quantity = $("input.quantity[data-stock-location-id='" + stock_location_id + "']").val();