From f294bf19a3d54efeee766d90a278291ac97ce3cc Mon Sep 17 00:00:00 2001 From: David Schnur Date: Sun, 3 Feb 2013 11:02:22 -0500 Subject: [PATCH] Cleaned up processOptions and bindEvents hooks. --- jquery.flot.pie.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/jquery.flot.pie.js b/jquery.flot.pie.js index 728d3cb..5978751 100644 --- a/jquery.flot.pie.js +++ b/jquery.flot.pie.js @@ -81,16 +81,9 @@ More detail and specific examples can be found in the included HTML file. // add hook to determine if pie plugin in enabled, and then perform necessary operations - plot.hooks.processOptions.push(checkPieEnabled); - plot.hooks.bindEvents.push(bindEvents); - - // check to see if the pie plugin is enabled - - function checkPieEnabled(plot, options) { + plot.hooks.processOptions.push(function(plot, options) { if (options.series.pie.show) { - //disable grid - options.grid.show = false; // set labels.show @@ -130,11 +123,11 @@ More detail and specific examples can be found in the included HTML file. plot.hooks.draw.push(draw); } - } + }); // bind hoverable events - function bindEvents(plot, eventHolder) { + plot.hooks.bindEvents.push(function(plot, eventHolder) { var options = plot.getOptions(); if (options.series.pie.show) { if (options.grid.hoverable) { @@ -144,7 +137,7 @@ More detail and specific examples can be found in the included HTML file. eventHolder.unbind("click").click(onClick); } } - } + }); // debugging function that prints out an object