Files
iD/js/lib/d3.one.js
2012-12-03 15:11:49 -05:00

9 lines
261 B
JavaScript

d3.selection.prototype.one = function (type, listener, capture) {
var target = this, typeOnce = type + ".once";
function one() {
target.on(typeOnce, null);
listener.apply(this, arguments);
}
target.on(typeOnce, one, capture);
};