From 6df2a921dd90148ec85e85c04f2b24a7ad081dd0 Mon Sep 17 00:00:00 2001 From: Jacob Lowe Date: Tue, 27 May 2014 12:13:37 -0700 Subject: [PATCH 1/2] removing appending warning to dom --- src/plugins/jquery.flot.pie.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/jquery.flot.pie.js b/src/plugins/jquery.flot.pie.js index 0395fbd..881cfd6 100644 --- a/src/plugins/jquery.flot.pie.js +++ b/src/plugins/jquery.flot.pie.js @@ -327,7 +327,9 @@ More detail and specific examples can be found in the included HTML file. if (attempts >= REDRAW_ATTEMPTS) { clear(); - target.prepend("
Could not draw pie with labels contained inside canvas
"); + if ( typeof console === 'object' && typeof console.warn === 'function' ) { + console.warn("Could not draw pie with labels contained inside canvas"); + } } if (plot.setSeries && plot.insertLegend) { From 46719d55fc5fdc624fe66c5c27bf4db1a935e32b Mon Sep 17 00:00:00 2001 From: Jacob Lowe Date: Tue, 27 May 2014 17:40:51 -0700 Subject: [PATCH 2/2] requested revisions, switching to dubs, and jshint declaration --- src/plugins/jquery.flot.pie.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/jquery.flot.pie.js b/src/plugins/jquery.flot.pie.js index 881cfd6..ac0cbcf 100644 --- a/src/plugins/jquery.flot.pie.js +++ b/src/plugins/jquery.flot.pie.js @@ -254,6 +254,8 @@ More detail and specific examples can be found in the included HTML file. function draw(plot, newCtx) { + /* global console */ + if (!target) { return; // if no series were passed } @@ -327,7 +329,7 @@ More detail and specific examples can be found in the included HTML file. if (attempts >= REDRAW_ATTEMPTS) { clear(); - if ( typeof console === 'object' && typeof console.warn === 'function' ) { + if ( typeof console === "object" && typeof console.warn === "function" ) { console.warn("Could not draw pie with labels contained inside canvas"); } }