mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-14 09:42:56 +00:00
This avoids unexpectedly deleting when you spam backspace to clear a failed search query.
10 lines
278 B
JavaScript
10 lines
278 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);
|
|
return this;
|
|
};
|