# HG changeset patch # User veltr # Date 1347586684 -32400 # Node ID 7c1d08cf6956ef3490389c354a430f1bf79b52a3 # Parent 5055aa35340f550dbf6d9920609c55664702392c delegate function in jQuery diff -r 5055aa35340f -r 7c1d08cf6956 src/widgets/Trace.js --- a/src/widgets/Trace.js Fri Sep 07 18:18:47 2012 +0200 +++ b/src/widgets/Trace.js Fri Sep 14 10:38:04 2012 +0900 @@ -63,12 +63,8 @@ this.tracer.trace("TraceWidgetInit", {}); this.mouseLocation = ''; - IriSP.jQuery(".Ldt-Widget").bind("click mouseover mouseout", function(_e) { - var _target = IriSP.jQuery(_e.target); - - while (!_target.hasClass("Ldt-TraceMe") && !_target.hasClass("Ldt-Widget") && _target.length) { - _target = _target.parent(); - } + IriSP.jQuery(".Ldt-Widget").on("click mouseover mouseout", ".Ldt-TraceMe", function(_e) { + var _target = IriSP.jQuery(this); var _widget = IriSP.jQuery(this).attr("widget-type"), _data = {