Remove useless target argument from ol.Event and subclass constructors

This commit is contained in:
Andreas Hocevar
2016-07-01 17:15:30 +02:00
parent 2845f50ff7
commit ccf15b8be3
12 changed files with 20 additions and 30 deletions
+6 -7
View File
@@ -40,11 +40,10 @@ ol.CollectionEventType = {
* @implements {oli.CollectionEvent}
* @param {ol.CollectionEventType} type Type.
* @param {*=} opt_element Element.
* @param {Object=} opt_target Target.
*/
ol.CollectionEvent = function(type, opt_element, opt_target) {
ol.CollectionEvent = function(type, opt_element) {
ol.events.Event.call(this, type, opt_target);
ol.events.Event.call(this, type);
/**
* The element that is added to or removed from the collection.
@@ -182,7 +181,7 @@ ol.Collection.prototype.insertAt = function(index, elem) {
this.array_.splice(index, 0, elem);
this.updateLength_();
this.dispatchEvent(
new ol.CollectionEvent(ol.CollectionEventType.ADD, elem, this));
new ol.CollectionEvent(ol.CollectionEventType.ADD, elem));
};
@@ -240,7 +239,7 @@ ol.Collection.prototype.removeAt = function(index) {
this.array_.splice(index, 1);
this.updateLength_();
this.dispatchEvent(
new ol.CollectionEvent(ol.CollectionEventType.REMOVE, prev, this));
new ol.CollectionEvent(ol.CollectionEventType.REMOVE, prev));
return prev;
};
@@ -257,9 +256,9 @@ ol.Collection.prototype.setAt = function(index, elem) {
var prev = this.array_[index];
this.array_[index] = elem;
this.dispatchEvent(
new ol.CollectionEvent(ol.CollectionEventType.REMOVE, prev, this));
new ol.CollectionEvent(ol.CollectionEventType.REMOVE, prev));
this.dispatchEvent(
new ol.CollectionEvent(ol.CollectionEventType.ADD, elem, this));
new ol.CollectionEvent(ol.CollectionEventType.ADD, elem));
} else {
var j;
for (j = n; j < index; ++j) {