Merge pull request #3336 from fredj/getTargetElement

Use ol.Map#getTargetElement function
This commit is contained in:
Frédéric Junod
2015-03-09 17:15:20 +01:00

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 an Element we append the viewport element to it.
var target = this.getTarget();
/**
* @type {Element}
*/
var targetElement = goog.isDef(target) ?
goog.dom.getElement(target) : null;
var targetElement = this.getTargetElement();
this.keyHandler_.detach();
@@ -1431,12 +1425,7 @@ ol.Map.prototype.skipFeature = function(feature) {
* @api stable
*/
ol.Map.prototype.updateSize = function() {
var target = this.getTarget();
/**
* @type {Element}
*/
var targetElement = goog.isDef(target) ? goog.dom.getElement(target) : null;
var targetElement = this.getTargetElement();
if (goog.isNull(targetElement)) {
this.setSize(undefined);