Skip to content

Commit

Permalink
Fixing a bug in IE where if you don't enable hovering but enable clic…
Browse files Browse the repository at this point in the history
…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
rfunduk committed Jul 30, 2008
1 parent 9ae4d2f commit 891d5c6
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions jquery.flot.js
Expand Up @@ -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]) {
Expand All @@ -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);
}
}
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 891d5c6

Please sign in to comment.