simplify the assignment of this.target_
This commit is contained in:
1 parent
e6c4fd973a
commit
2fc884a3d9
2 files changed
+5
-7
No files matched your search
@@ -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