Skip to content

Commit

Permalink
Merge pull request #2062 from nebulab/admin_order_hover_add_variant
Browse files Browse the repository at this point in the history
Display a pointer cursor hovering add variant buttons
  • Loading branch information
kennyadsl authored Aug 3, 2017
2 parents ec13f80 + ac81e0a commit 409e2ee
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 19 deletions.
16 changes: 8 additions & 8 deletions backend/app/assets/javascripts/spree/backend/shipments.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ var ShipmentItemView = Backbone.View.extend({
},

events: {
"click .delete-item": "onDelete",
"click .split-item": "onSplit",
"click button.delete-item": "onDelete",
"click button.split-item": "onSplit",
},

removeSplit: function() {
Expand Down Expand Up @@ -290,13 +290,13 @@ var ShipmentEditView = Backbone.View.extend({
},

events: {
"click a.edit-method": "toggleMethodEdit",
"click a.cancel-method": "toggleMethodEdit",
"click a.save-method": "saveMethod",
"click button.edit-method": "toggleMethodEdit",
"click button.cancel-method": "toggleMethodEdit",
"click button.save-method": "saveMethod",

"click a.edit-tracking": "toggleTrackingEdit",
"click a.cancel-tracking": "toggleTrackingEdit",
"click a.save-tracking": "saveTracking",
"click button.edit-tracking": "toggleTrackingEdit",
"click button.cancel-tracking": "toggleTrackingEdit",
"click button.save-tracking": "saveTracking",
},

toggleMethodEdit: function(e){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<fieldset class="no-border-bottom">
<legend align="center" class="stock-location">
<button class="add_variant" title="{{ t "add" }}" data-action="add">{{ t "add" }}</button>
<button class="add_variant" title="{{ t "add" }}" data-action="add">{{ t "add" }}</button>
</legend>
</fieldset>
</fieldset>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
<input class="quantity" id="item_quantity" type="number" min="1" value="1" max="{{max_quantity}}">
</td>
<td class='actions'>
<a href='#' class='save-split icon_link fa fa-ok no-text with-tip' title='Save'></a>
<a href='#' class='cancel-split icon_link fa fa-cancel no-text with-tip' title='Cancel'></a>
<button class="save-split icon_link fa fa-ok no-text with-tip" data-action="save" title="{{ t "save" }}" data-original-title="{{ t "save" }}"></button>
<button class="cancel-split icon_link fa fa-cancel no-text with-tip" data-action="cancel" title="{{ t "cancel" }}" data-original-title="{{ t "cancel" }}"></button>
</td>
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,9 @@ table tbody tr {

td.actions {
background-color: transparent !important;

button {
cursor: pointer;
}
}
}
12 changes: 6 additions & 6 deletions backend/app/views/spree/admin/orders/_shipment.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
</td>
<td class="actions">
<% if can? :update, shipment %>
<%= link_to '', '#', class: 'save-method fa fa-check no-text with-tip',
<%= button_tag '', class: 'save-method fa fa-check no-text with-ti, type: :button',
data: {'shipment-number' => shipment.number, action: 'save'}, title: Spree.t('actions.save') %>
<%= link_to '', '#', class: 'cancel-method fa fa-cancel no-text with-tip',
<%= button_tag '', class: 'cancel-method fa fa-cancel no-text with-ti, type: :button',
data: {action: 'cancel'}, title: Spree.t('actions.cancel') %>
<% end %>
</td>
Expand All @@ -85,7 +85,7 @@

<td class="actions">
<% if can?(:update, shipment) && !shipment.shipped? %>
<%= link_to '', '#', class: 'edit-method fa fa-edit no-text with-tip', data: {action: 'edit'}, title: Spree.t('actions.edit') %>
<%= button_tag '', class: 'edit-method fa fa-edit no-text with-tip', data: {action: 'edit'}, title: Spree.t('actions.edit'), type: :button %>
<% end %>
</td>
</tr>
Expand All @@ -97,8 +97,8 @@
</td>
<td class="actions">
<% if can? :update, shipment %>
<%= link_to '', '#', class: 'save-tracking fa fa-check no-text with-tip', data: {'shipment-number' => shipment.number, action: 'save'}, title: Spree.t('actions.save') %>
<%= link_to '', '#', class: 'cancel-tracking fa fa-cancel no-text with-tip', data: {action: 'cancel'}, title: Spree.t('actions.cancel') %>
<%= button_tag '', class: 'save-tracking fa fa-check no-text with-tip', data: { action: 'save', 'shipment-number' => shipment.number }, title: Spree.t('actions.save'), type: :button %>
<%= button_tag '', class: 'cancel-tracking fa fa-cancel no-text with-tip', data: { action: 'cancel' }, title: Spree.t('actions.cancel'), type: :button %>
<% end %>
</td>
</tr>
Expand All @@ -121,7 +121,7 @@
</td>
<td class="actions">
<% if can? :update, shipment %>
<%= link_to '', '#', class: 'edit-tracking fa fa-edit no-text with-tip', data: {action: 'edit'}, title: Spree.t('actions.edit') %>
<%= button_tag '', class: 'edit-tracking fa fa-edit no-text with-tip', data: {action: 'edit'}, title: Spree.t('actions.edit'), type: :button %>
<% end %>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

<td class="cart-item-delete actions" data-hook="cart_item_delete">
<% if can? :update, item %>
<%= link_to '', '#', class: 'split-item icon_link fa fa-arrows-h no-text with-tip', data: {action: 'split', 'variant-id' => item.variant.id}, title: Spree.t('actions.split') %>
<%= link_to '', '#', class: 'delete-item fa fa-trash no-text with-tip', data: { 'variant-id' => item.variant.id}, title: Spree.t('actions.delete') %>
<%= button_tag '', class: 'split-item icon_link fa fa-arrows-h no-text with-tip', data: { action: 'split', 'variant-id' => item.variant.id }, title: Spree.t('actions.split'), type: :button %>
<%= button_tag '', class: 'delete-item fa fa-trash no-text with-tip', data: { 'variant-id' => item.variant.id }, title: Spree.t('actions.delete'), type: :button %>
<% end %>
</td>
</tr>
Expand Down

0 comments on commit 409e2ee

Please sign in to comment.