Skip to content

Commit

Permalink
Add from submit events to shipment forms
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdeyen committed Jan 10, 2018
1 parent 3a1c73f commit dac6cbd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion backend/app/assets/javascripts/spree/backend/shipments.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
var ShipmentAddVariantView = Backbone.View.extend({
events: {
"change #add_variant_id": "onSelect",
"click .add_variant": "onAdd"
"click .add_variant": "onAdd",
"submit form": "onAdd"
},
onSelect: function(e) {
var variant_id = this.$("#add_variant_id").val();
Expand Down Expand Up @@ -132,6 +133,7 @@ var ShipmentSplitItemView = Backbone.View.extend({
events: {
"click .cancel-split": "cancelItemSplit",
"click .save-split": "completeItemSplit",
"submit form": "completeItemSplit",
},

cancelItemSplit: function(e){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
It doesn't track inventory
</td>
<td>
<input class="quantity" id="stock_item_quantity" data-stock-location-id="{{this.stock_location_id}}" type="number" min="1" value="1">
<form>
<input class="quantity" id="stock_item_quantity" data-stock-location-id="{{this.stock_location_id}}" type="number" min="1" value="1">
</form>
</td>
<td class="actions">
<button class="add_variant no-text fa fa-plus icon_link with-tip" data-stock-location-id="{{this.stock_location_id}}" title="{{ t "add" }}" data-action="add"></button>
Expand All @@ -34,7 +36,9 @@
{{#if this.backorderable}} ({{ t "backorders_allowed" }}) {{/if}}
</td>
<td>
<input class="quantity" id="stock_item_quantity" data-stock-location-id="{{this.stock_location_id}}" type="number" min="1" value="1">
<form>
<input class="quantity" id="stock_item_quantity" data-stock-location-id="{{this.stock_location_id}}" type="number" min="1" value="1">
</form>
</td>
<td class="actions">
<button class="add_variant no-text fa fa-plus icon_link with-tip" data-stock-location-id="{{this.stock_location_id}}" title="{{ t "add" }}" data-action="add"></button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
</select>
</td>
<td>
<input class="quantity" id="item_quantity" type="number" min="1" value="1" max="{{max_quantity}}">
<form>
<input class="quantity" id="item_quantity" type="number" min="1" value="1" max="{{max_quantity}}">
</form>
</td>
<td class='actions'>
<button class="save-split icon_link fa fa-ok no-text with-tip" data-action="save" title="{{ t "actions.save" }}"></button>
Expand Down

0 comments on commit dac6cbd

Please sign in to comment.