Closed GoogleCodeExporter closed 8 years ago
I appreciate the thought you've put into this suggestion, but I'm not (yet)
convinced this is big enough of a problem to fix in this way. It appears to me
you should fix your plugin to do the right thing and check itself via options
whether it should register the listener or not - that way the option to disable
it can also look a bit more natural, that at least appears to have been the
case for some of the other plugins. I know this means a bit extra code compared
to handling it generically, something like
if (!plot.getOptions().blahblah.enabled)
return;
but it does mean extra flexibility and is perhaps also a bit easier to
understand from the point of view of the writing a plugin.
Original comment by olau%iol...@gtempaccount.com
on 9 Aug 2011 at 10:01
Thanks for the response. I initially tried your suggestion, but the plugin's
options aren't accessible using plot.getOptions() because you have them merged
after init is called, so it didn't work:
function initPlugins() {
for (var i = 0; i < plugins.length; ++i) {
var p = plugins[i];
---> p.init(plot);
if (p.options)
---> $.extend(true, options, p.options);
}
}
Is there a reason why those are in that order?
Original comment by m...@webxl.net
on 9 Aug 2011 at 6:41
Original comment by dnsch...@gmail.com
on 4 Jun 2012 at 2:41
Original issue reported on code.google.com by
m...@webxl.net
on 4 Aug 2011 at 10:40