Use ol.Map#getTargetElement function

This commit is contained in:
Frederic Junod
2015-03-09 16:20:44 +01:00
parent 9951c88343
commit 7dcef882c2
+2 -13
View File
@@ -1024,13 +1024,7 @@ ol.Map.prototype.handleTargetChanged_ = function() {
// If it's not now an Element we remove the viewport from the DOM. // If it's not now an Element we remove the viewport from the DOM.
// If it's an Element we append the viewport element to it. // If it's an Element we append the viewport element to it.
var target = this.getTarget(); var targetElement = this.getTargetElement();
/**
* @type {Element}
*/
var targetElement = goog.isDef(target) ?
goog.dom.getElement(target) : null;
this.keyHandler_.detach(); this.keyHandler_.detach();
@@ -1431,12 +1425,7 @@ ol.Map.prototype.skipFeature = function(feature) {
* @api stable * @api stable
*/ */
ol.Map.prototype.updateSize = function() { ol.Map.prototype.updateSize = function() {
var target = this.getTarget(); var targetElement = this.getTargetElement();
/**
* @type {Element}
*/
var targetElement = goog.isDef(target) ? goog.dom.getElement(target) : null;
if (goog.isNull(targetElement)) { if (goog.isNull(targetElement)) {
this.setSize(undefined); this.setSize(undefined);