From e55b5b4d616c5fde5dc859ceed6e4f74989810e5 Mon Sep 17 00:00:00 2001 From: Ole Laursen Date: Fri, 3 Jun 2011 18:30:46 +0200 Subject: [PATCH] Prefix canvas classes with "flot-" to prevent clashes, mostly a problem with .overlay (reported by bcraysie/Bob Cravens, issue 540) --- NEWS.txt | 2 ++ jquery.flot.js | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/NEWS.txt b/NEWS.txt index d29b76f..b5df75f 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -11,6 +11,8 @@ the canvas API (this doesn't affect IE); if this is a problem, either continue using an older version of Flot or try an emulation helper such as canvas-text or Flashcanvas. +The base and overlay canvas are now using the CSS classes "flot-base" +and "flot-overlay" to prevent accidental clashes (issue 540). Changes: diff --git a/jquery.flot.js b/jquery.flot.js index 576bcd5..65ebe45 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -735,8 +735,8 @@ function setupCanvases() { var reused, - existingCanvas = placeholder.children("canvas.base"), - existingOverlay = placeholder.children("canvas.overlay"); + existingCanvas = placeholder.children("canvas.flot-base"), + existingOverlay = placeholder.children("canvas.flot-overlay"); if (existingCanvas.length == 0 || existingOverlay == 0) { // init everything @@ -750,8 +750,8 @@ getCanvasDimensions(); - canvas = makeCanvas(true, "base"); - overlay = makeCanvas(false, "overlay"); // overlay canvas for interactive features + canvas = makeCanvas(true, "flot-base"); + overlay = makeCanvas(false, "flot-overlay"); // overlay canvas for interactive features reused = false; }