simplify the assignment of this.target_
This commit is contained in:
@@ -30,12 +30,10 @@ ol.control.Control = function(options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Element|undefined}
|
||||
* @type {?Element}
|
||||
*/
|
||||
this.target_ = goog.isDef(options.target) ? (goog.isString(options.target) ?
|
||||
goog.dom.getElement(options.target) !== null ?
|
||||
goog.dom.getElement(options.target) : undefined : options.target) :
|
||||
undefined;
|
||||
this.target_ = goog.isDef(options.target) ?
|
||||
goog.dom.getElement(options.target) : null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -98,7 +96,7 @@ ol.control.Control.prototype.setMap = function(map) {
|
||||
}
|
||||
this.map_ = map;
|
||||
if (!goog.isNull(this.map_)) {
|
||||
var target = goog.isDef(this.target_) ?
|
||||
var target = !goog.isNull(this.target_) ?
|
||||
this.target_ : map.getOverlayContainerStopEvent();
|
||||
goog.dom.appendChild(target, this.element);
|
||||
if (this.handleMapPostrender !== goog.nullFunction) {
|
||||
|
||||
Reference in New Issue
Block a user