Permalink
Browse files

Fixing a bug in IE where if you don't enable hovering but enable clic…

…king the data doesn't get sorted but we still try to only go through the relevant

 half of the data when looking up clicked-points... Anyway, I'm pretty sure this solves it :)
  • Loading branch information...
1 parent 9ae4d2f commit 891d5c658d66991cf77bc9386262c876fffd317b @rfunduk rfunduk committed Jul 30, 2008
Showing with 13 additions and 7 deletions.
  1. +13 −7 jquery.flot.js
View
20 jquery.flot.js
@@ -170,7 +170,7 @@ BOTTOM_SIDE_BUFFER = 5;
var s;
if (d[i].data) {
s = {};
- if (options.sortData && options.grid.hoverable) {
+ if (options.sortData) {
d[i].data.sort(sortData);
}
for (var v in d[i]) {
@@ -179,7 +179,7 @@ BOTTOM_SIDE_BUFFER = 5;
}
else {
s = { data: d[i] };
- if (options.sortData && options.grid.hoverable) {
+ if (options.sortData) {
d[i].sort(sortData);
}
}
@@ -1597,13 +1597,19 @@ BOTTOM_SIDE_BUFFER = 5;
for (var i = 0; i < series.length; ++i) {
var data = series[i].data;
- var half = tHoz(data[(data.length/2).toFixed(0)][0]).toFixed(0);
- if (mouseX < half) {
- start = 0;
- end = (data.length/2).toFixed(0) + 5;
+ if (options.sortData) {
+ var half = tHoz(data[(data.length/2).toFixed(0)][0]).toFixed(0);
+ if (mouseX < half) {
+ start = 0;
+ end = (data.length/2).toFixed(0) + 5;
+ }
+ else {
+ start = (data.length/2).toFixed(0) - 5;
+ end = data.length;
+ }
}
else {
- start = (data.length/2).toFixed(0) - 5;
+ start = 0;
end = data.length;
}

0 comments on commit 891d5c6

Please sign in to comment.