Mercurial > pub > ImplabJs
comparison src/djol/listen.js @ 34:27e8e9e38e07 default tip
Слияние
author | nickolay |
---|---|
date | Wed, 05 Jun 2019 20:44:15 +0300 |
parents | 8af8e840dd49 1dc2fd263b90 |
children |
comparison
equal
deleted
inserted
replaced
33:8af8e840dd49 | 34:27e8e9e38e07 |
---|---|
1 define(["ol"], function(ol) { | |
2 | |
3 var listen = function(target, event, callback) { | |
4 var key = target.on(event, callback); | |
5 return { | |
6 remove : function() { | |
7 ol.Observable.unByKey(key); | |
8 } | |
9 }; | |
10 }; | |
11 | |
12 listen.once = function(target, event, callback) { | |
13 var key = target.once(event, callback); | |
14 return { | |
15 remove : function() { | |
16 ol.Observable.unByKey(key); | |
17 } | |
18 }; | |
19 }; | |
20 | |
21 return listen; | |
22 }); |