Skip to content

Commit 165c6d2

Browse files
committed
remove this.leaflet && in if condition
1 parent d06415a commit 165c6d2

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

src/index.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,16 @@ L.Control.SplitMap = L.Control.extend({
9494
if (!this._map) {
9595
return this
9696
}
97-
if (this._leftLayer && this._leftLayer.getContainer) {
97+
if (this._leftLayer.getContainer) {
9898
this._leftLayer.getContainer().style.clip = ""
9999
} else {
100-
this._leftLayer.getPane().style.clip = ""
101-
}
102-
if (this._rightLayer && this._rightLayer.getContainer) {
100+
this._leftLayer.getPane().style.clip = ""
101+
}
102+
if (this._rightLayer.getContainer) {
103103
this._rightLayer.getContainer().style.clip = ""
104104
} else {
105105
this._rightLayer.getPane().style.clip = ""
106-
}
106+
}
107107

108108
this._removeEvents()
109109
L.DomUtil.remove(this._container)
@@ -136,17 +136,17 @@ L.Control.SplitMap = L.Control.extend({
136136
this.fire('dividermove', {x: dividerX})
137137
var clipLeft = 'rect(' + [nw.y, clipX, se.y, nw.x].join('px,') + 'px)'
138138
var clipRight = 'rect(' + [nw.y, se.x, se.y, clipX].join('px,') + 'px)'
139-
if (this._leftLayer && this._leftLayer.getContainer) {
139+
if (this._leftLayer.getContainer) {
140140
this._leftLayer.getContainer().style.clip = clipLeft
141141
} else {
142-
this._leftLayer.getPane().style.clip = clipLeft
143-
}
144-
if (this._rightLayer && this._rightLayer.getContainer) {
142+
this._leftLayer.getPane().style.clip = clipLeft
143+
}
144+
if (this._rightLayer.getContainer) {
145145
this._rightLayer.getContainer().style.clip = clipRight
146146
} else {
147147
this._rightLayer.getPane().style.clip = clipRight
148-
}
149-
},
148+
}
149+
},
150150

151151
_updateLayers: function () {
152152
if (!this._map) {

0 commit comments

Comments
 (0)