Improve type checking in ol.Object#bindTo

This commit is contained in:
Tom Payne
2014-01-29 20:54:09 +01:00
parent c5dd7988c9
commit ce3209a439

View File

@@ -235,9 +235,13 @@ ol.Object.prototype.bindTo = function(key, target, opt_targetKey) {
// listen for change:targetkey events
var eventType = ol.Object.getChangeEventType(targetKey);
this.listeners_[key] = goog.events.listen(target, eventType, function() {
this.notifyInternal_(key);
}, undefined, this);
this.listeners_[key] = goog.events.listen(target, eventType,
/**
* @this {ol.Object}
*/
function() {
this.notifyInternal_(key);
}, undefined, this);
// listen for beforechange events and relay if key matches
this.beforeChangeListeners_[key] = goog.events.listen(target,