Skip to content

Commit

Permalink
BUGFIX: storeLocator.js - pareseFloat distance
Browse files Browse the repository at this point in the history
Location - cast `distance` as Decimal rather than Int
  • Loading branch information
jsirish committed Oct 11, 2016
1 parent 072c970 commit db7c786
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion code/objects/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Location extends DataObject implements PermissionProvider
* @var array
*/
private static $casting = array(
'distance' => 'Int',
'distance' => 'Decimal(9,3)',
);

/**
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/jquery-store-locator/js/jquery.storelocator.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ $.fn.storeLocator = function(options) {
'hours3': $(this).attr('hours3'),
'category': $(this).attr('category'),
'featured': $(this).attr('featured'),
'distance': $(this).attr('distance')
'distance': parseFloat($(this).attr('distance'))
};

if(locationData['web']) locationData['web'] = locationData['web'].replace("http://",""); // Remove scheme (todo: should NOT be done)
Expand Down

0 comments on commit db7c786

Please sign in to comment.