allow direct access to 'eventHolder' object for custom events #817

dnschnur opened this Issue Sep 28, 2012 · 0 comments


None yet
1 participant

dnschnur commented Sep 28, 2012

Original author: (August 14, 2012 19:07:51)

feature request:
allow direct, arbitrary access to the 'eventHolder' canvas object

currently, it is a somewhat clumsy task to try to get the 'eventHolder' object:

  1. hack into the flot source code & manually expose it:

  2. use the 'bindEvents' hook to 'grab&save' a reference to the object:
    var eHolder=null;
    var pltOpts={};
    //do stuff with eHolder, since it should now be defined
    //reason this might be necessary is for 'delayed/postponed event binding&unbinding'
    //i.e., cases where you dont want or cant define event handlers using the 'bindEvents' hooks

  3. manually try to 'select' the eventHolder object (which is ugly & might be unreliable?)
    var eventHolder=$("#plot_div canvas.overlay");

add a simple 'getter' function that returns the internal 'eventHolder' canvas object;
For event-binding safety, I guess you could do a simple internal test to see 'bindEvents' has already been executed, and return 'false' if not; otherwise, return the canvas obj. But realistically, I dont think this would be a problem. thoughts/feedback?

var eventsDone_=false;

function bindEvents(){
return (eventsDone_)?eventHolder:false;

Original issue:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment