1
0
mirror of https://github.com/fspc/Yellow-Bike-Database.git synced 2025-02-23 09:13:23 -05:00

Fixes a bug when decimal places get too large for nouislider.

This commit is contained in:
Jonathan Rosenbaum 2015-01-27 08:26:17 +00:00
parent cdbfd74ddb
commit 597982369d

View File

@ -205,6 +205,7 @@ $(function() {
min_range = max_range_last_year; min_range = max_range_last_year;
} }
var percentage_amounts = 100 / (range.length - 1); var percentage_amounts = 100 / (range.length - 1);
percentage_amounts = Number(Math.round(percentage_amounts+'e2')+'e-2');
var percentage = percentage_amounts; var percentage = percentage_amounts;
$.each(range,function(k,v) { $.each(range,function(k,v) {
@ -216,7 +217,10 @@ $(function() {
range_obj[percentage_amounts + '%'] = Number(v); range_obj[percentage_amounts + '%'] = Number(v);
percentage_amounts = percentage_amounts + percentage; percentage_amounts = percentage_amounts + percentage;
} }
// watch that percentage don't aquire too many decimal points.
//console.dir(range_obj);
}); });
//initialize slider //initialize slider
@ -283,6 +287,7 @@ $(function() {
}); });
$(this).val(lookup_object.minus[value]); $(this).val(lookup_object.minus[value]);
} }
}); // End - Do not let both handles have the same value }); // End - Do not let both handles have the same value