From 4e5c800c6a2c0c2a31c9f82b99ef4f40fd79a757 Mon Sep 17 00:00:00 2001 From: yaelelmatad Date: Mon, 9 Jul 2012 15:55:56 -0400 Subject: [PATCH 1/2] Throw error when flot.time plugin is missing. Fixes issues 709 on google code. --- jquery.flot.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jquery.flot.js b/jquery.flot.js index 0817fd8..df868d3 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -1222,6 +1222,9 @@ return v.toFixed(axis.tickDecimals); }; } + else if (opts.mode === "time" && typeof axis.tickGenerator === "undefined") { + throw new Error("Time mode requires the flot.time plugin."); + } if ($.isFunction(opts.tickFormatter)) axis.tickFormatter = function (v, axis) { return "" + opts.tickFormatter(v, axis); }; From 8beb199e8df1cf8a373be659b29c1eb725ca017f Mon Sep 17 00:00:00 2001 From: yaelelmatad Date: Tue, 10 Jul 2012 11:36:33 -0400 Subject: [PATCH 2/2] Edited request for Ticket 709, Deprecation Mesg We changed the === to == and removed the typeof operator. We also changed the tabs to spaces. --- jquery.flot.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.flot.js b/jquery.flot.js index df868d3..40e5fc7 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -1222,9 +1222,9 @@ return v.toFixed(axis.tickDecimals); }; } - else if (opts.mode === "time" && typeof axis.tickGenerator === "undefined") { + else if (opts.mode == "time" && axis.tickGenerator == undefined) { throw new Error("Time mode requires the flot.time plugin."); - } + } if ($.isFunction(opts.tickFormatter)) axis.tickFormatter = function (v, axis) { return "" + opts.tickFormatter(v, axis); };