Hareeshchandera / jsplumb

Automatically exported from code.google.com/p/jsplumb
0 stars 0 forks source link

add 'filter' parameter to makeSource #253

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
see this jsFiddle:

http://jsfiddle.net/sporritt/49Qft/

clicking on the button causes an endpoint to be added. this is probably not 
awesome.

Original issue reported on code.google.com by simon.po...@gmail.com on 7 Jun 2012 at 11:09

GoogleCodeExporter commented 8 years ago
one thought i had was that we could possibly support a 'filter' - pass the 
original mouse event to this filter and if it returns false then we take no 
action.

Original comment by simon.po...@gmail.com on 21 Jun 2012 at 12:06

GoogleCodeExporter commented 8 years ago
..and so i added the filter idea:

<div id="foo">
  FOO
  <button>click me</button>
</div>

jsPlumb.makeSource("foo", {
  filter:function(event, element) {
    return event.target.tagName !== "BUTTON";
  }
});

Original comment by simon.po...@gmail.com on 21 Jun 2012 at 9:57

GoogleCodeExporter commented 8 years ago

Original comment by simon.po...@gmail.com on 21 Jun 2012 at 10:11