Add delete tracking feature

This commit is contained in:
binarygit
2022-07-09 14:39:20 +05:45
parent b7a49ced39
commit b88c85555e
2 changed files with 6 additions and 0 deletions

View File

@@ -141,7 +141,12 @@ doAdjustItems = function(shipment_number, variant_id, quantity, inventory_units,
toggleTrackingEdit = function(){
var link = $(this);
let input = link.parents('tbody').find('#tracking')[0]
link.parents('tbody').find('tr.edit-tracking').toggle();
// Set focus on input and
// put cursor at it's end
input.focus()
input.setSelectionRange(-1, -1)
link.parents('tbody').find('tr.show-tracking').toggle();
}

View File

@@ -85,3 +85,4 @@
%td.actions
- if can?(:update, shipment) && shipment.can_modify?
= link_to '', '', :class => 'edit-tracking icon_link icon-edit no-text with-tip', :data => { :action => 'edit' }, :title => Spree.t('edit')
= link_to '', '', :class => 'delete-tracking icon_link icon-trash no-text with-tip', :data => { 'shipment-number' => shipment.number, :action => 'delete' }