Browse Source

docs : use `parseFloat` for weight sorting data. Resolves #5

v1
David DeSandro 14 years ago
parent
commit
250e19107f
  1. 2
      _layouts/elements.html
  2. 2
      _posts/demos/2010-12-30-sorting.html

2
_layouts/elements.html

@ -97,7 +97,7 @@
return parseInt( $elem.find('.number').text(), 10 );
},
weight : function( $elem ) {
return parseInt( $elem.find('.weight').text().replace( /[\(\)]/g, ''), 10 );
return parseFloat( $elem.find('.weight').text().replace( /[\(\)]/g, '') );
},
name : function ( $elem ) {
return $elem.find('.name').text();

2
_posts/demos/2010-12-30-sorting.html

@ -44,7 +44,7 @@ related: sorting
return parseInt( $elem.find('.number').text(), 10 );
},
weight : function( $elem ) {
return parseInt( $elem.find('.weight').text().replace( /[\(\)]/g, ''), 10 );
return parseFloat( $elem.find('.weight').text().replace( /[\(\)]/g, '') );
},
name : function ( $elem ) {
return $elem.find('.name').text();

Loading…
Cancel
Save