Skip to content

Commit

Permalink
only remove the attribute open from container in compact===undefined …
Browse files Browse the repository at this point in the history
…mode, if it changed from big to small size
  • Loading branch information
astridx committed Dec 3, 2021
1 parent 92e230e commit a1272d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ui/control/attribution_control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,10 @@ class AttributionControl implements IControl {

_updateCompact() {
if (this._map.getCanvasContainer().offsetWidth <= 640) {
if (!this._container.classList.contains('maplibregl-compact')) {
this._container.removeAttribute('open');
}
this._container.classList.add('maplibregl-compact', 'mapboxgl-compact');
this._container.removeAttribute('open');
} else {
this._container.setAttribute('open', '');
this._container.classList.remove('maplibregl-compact', 'maplibregl-compact-show', 'mapboxgl-compact', 'mapboxgl-compact-show');
Expand Down

0 comments on commit a1272d9

Please sign in to comment.