Skip to content

Commit

Permalink
Fixed Admin JS incompatible with UUIDs (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
damianlegawiec authored Dec 21, 2021
1 parent cdc7aa8 commit bbf190d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/spree/backend/global/sortable.es6
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ document.addEventListener("spree:load", function() {
var itemEl = evt.item
var positions = { authenticity_token: AUTH_TOKEN }
$.each($('tr', element), function(position, obj) {
var reg = /spree_(\w+_?)+_(\d+)/
var reg = /spree_(\w+_?)+_(.*)/
var parts = reg.exec($(obj).prop('id'))
if (parts) {
positions['positions[' + parts[2] + ']'] = position + 1
Expand Down
4 changes: 2 additions & 2 deletions app/assets/javascripts/spree/backend/states.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ document.addEventListener("spree:load", function() {
$('#country').on('change', function () {
var newStateLinkHref = $('#new_state_link').prop('href')
var selectedCountryId = $('#country option:selected').prop('value')
var newLink = newStateLinkHref.replace(/countries\/(\d+)/,
'countries/' + selectedCountryId)
var newLink = newStateLinkHref.replace(/countries\/(.+)\/states\/new/,
'countries/' + selectedCountryId + '/states/new')
$('#new_state_link').attr('href', newLink)
})
};
Expand Down

0 comments on commit bbf190d

Please sign in to comment.