Test isElement instead of isDef (thanks @fredj)

This commit is contained in:
Éric Lemoine
2013-04-23 14:44:36 +02:00
parent 29e69d3833
commit d3d0d1e007

View File

@@ -691,10 +691,14 @@ ol.Map.prototype.handleSizeChanged_ = function() {
* @private
*/
ol.Map.prototype.handleTargetChanged_ = function() {
// target may be undefined, null or an Element. If it's not
// an Element we remove the viewport from the DOM. If it's
// an Element we append the viewport element to it.
var target = this.getTarget();
if (!goog.isDef(target)) {
if (!goog.dom.isElement(target)) {
goog.dom.removeNode(this.viewport_);
} else {
goog.asserts.assert(goog.isDefAndNotNull(target));
goog.dom.appendChild(target, this.viewport_);
}
this.updateSize();