From 00232cb0d27839cf815818436a4419a87b88bd96 Mon Sep 17 00:00:00 2001 From: "olau@iola.dk" Date: Thu, 25 Feb 2010 21:05:18 +0000 Subject: [PATCH] Avoid using $.browser.msie git-svn-id: https://flot.googlecode.com/svn/trunk@233 1e0a6537-2640-0410-bfb7-f154510ff394 --- NEWS.txt | 2 ++ jquery.flot.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS.txt b/NEWS.txt index dd96bf1..a2d560d 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -27,6 +27,8 @@ Bug fixes: - Fixed problem with plugins adding options to the series objects. - Fixed a problem introduced in 0.6 with specifying a gradient with { brightness: x, opacity: y }. +- Don't use $.browser.msie, check for getContext on the created canvas + element instead and try to use excanvas if it's not found. Flot 0.6 -------- diff --git a/jquery.flot.js b/jquery.flot.js index 663bb92..e0747f2 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -541,7 +541,7 @@ var c = document.createElement('canvas'); c.width = width; c.height = height; - if ($.browser.msie) // excanvas hack + if (!c.getContext) // excanvas hack c = window.G_vmlCanvasManager.initElement(c); return c; } @@ -555,7 +555,7 @@ if (canvasWidth <= 0 || canvasHeight <= 0) throw "Invalid dimensions for plot, width = " + canvasWidth + ", height = " + canvasHeight; - if ($.browser.msie) // excanvas hack + if (window.G_vmlCanvasManager) // excanvas hack window.G_vmlCanvasManager.init_(document); // make sure everything is setup // the canvas