From cc6f7b105255265076d9320a8c3fe2a36824c453 Mon Sep 17 00:00:00 2001 From: Andrew Harvey Date: Sat, 7 Apr 2018 22:10:15 +1000 Subject: [PATCH] make lint happy --- src/ui/control/logo_control.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ui/control/logo_control.js b/src/ui/control/logo_control.js index 5a412fa3c25..a5567c7f133 100644 --- a/src/ui/control/logo_control.js +++ b/src/ui/control/logo_control.js @@ -73,10 +73,14 @@ class LogoControl { } _updateCompact() { - if (this._map.getCanvasContainer().offsetWidth < 250) { - this._container.children.length && this._container.children[0].classList.add('mapboxgl-compact'); - } else { - this._container.children.length && this._container.children[0].classList.remove('mapboxgl-compact'); + const containerChildren = this._container.children; + if (containerChildren.length) { + const anchor = children[0]; + if (this._map.getCanvasContainer().offsetWidth < 250) { + anchor.classList.add('mapboxgl-compact'); + } else { + anchor.classList.remove('mapboxgl-compact'); + } } }