Making Element/Node types more consistent.

This commit is contained in:
ahocevar
2012-06-24 22:12:38 +02:00
parent eabc2d9922
commit 9758910fc6
3 changed files with 38 additions and 15 deletions
+2 -2
View File
@@ -146,7 +146,7 @@ ol.event.Events.prototype.getElement = function() {
* Attach this instance to a DOM element. When called, all browser events fired
* on the provided element will be relayed by this instance.
*
* @param {Element} element A DOM element to attach
* @param {Element|Node} element A DOM element to attach
* browser events to. If called without this argument, all browser events
* will be detached from the element they are currently attached to.
*/
@@ -161,7 +161,7 @@ ol.event.Events.prototype.setElement = function(element) {
this.destroySequences();
delete this.element_;
}
this.element_ = element || null;
this.element_ = /** @type {Element} */ (element) || null;
if (goog.isDefAndNotNull(element)) {
this.createSequences();
for (t in types) {