nakarte

Source code of https://map.sikmir.ru (fork)
git clone git://git.sikmir.ru/nakarte
Log | Files | Refs | LICENSE

commit 51615e365cfe5dd238c438643616d1b0529a1bfe
parent 0e43ce2fbdd8f4856f9c9eca83ae268093d0b862
Author: Sergej Orlov <wladimirych@gmail.com>
Date:   Wed,  9 May 2018 20:14:47 +0300

common highlight class for active buttons #64

Diffstat:
Msrc/lib/leaflet.control.azimuth/index.js | 2++
Msrc/lib/leaflet.control.azimuth/style.css | 4----
Msrc/lib/leaflet.control.commons/style.css | 7+++++--
Msrc/lib/leaflet.control.coordinates/index.js | 1+
Msrc/lib/leaflet.control.locate/index.js | 6+++---
Msrc/lib/leaflet.control.locate/style.css | 3---
6 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/src/lib/leaflet.control.azimuth/index.js b/src/lib/leaflet.control.azimuth/index.js @@ -115,6 +115,7 @@ L.Control.Azimuth = L.Control.extend({ enableControl: function() { L.DomUtil.addClass(this._container, 'active'); + L.DomUtil.addClass(this._container, 'highlight'); L.DomUtil.addClass(this._map._container, 'azimuth-control-active'); this._map.on('click', this.onMapClick, this); this.fire('enabled'); @@ -124,6 +125,7 @@ L.Control.Azimuth = L.Control.extend({ disableControl: function() { L.DomUtil.removeClass(this._container, 'active'); + L.DomUtil.removeClass(this._container, 'highlight'); this.hideProfile(); this.setPoints({start: null, end: null}); L.DomUtil.removeClass(this._map._container, 'azimuth-control-active'); diff --git a/src/lib/leaflet.control.azimuth/style.css b/src/lib/leaflet.control.azimuth/style.css @@ -44,7 +44,3 @@ .azimuth-control-active { cursor: crosshair; } - -.leaflet-control-azimuth.active a { - background-color: #cce8ff; -} diff --git a/src/lib/leaflet.control.commons/style.css b/src/lib/leaflet.control.commons/style.css @@ -22,4 +22,8 @@ .button-with-bar.active .bar { display: block; -} -\ No newline at end of file +} + +.highlight a, .highlight a:hover { + background-color: #cce8ff; +} diff --git a/src/lib/leaflet.control.coordinates/index.js b/src/lib/leaflet.control.coordinates/index.js @@ -145,6 +145,7 @@ L.Control.Coordinates = L.Control.extend({ const classFunc = enabled ? 'addClass' : 'removeClass'; const eventFunc = enabled ? 'on' : 'off'; L.DomUtil[classFunc](this._container, 'active'); + L.DomUtil[classFunc](this._container, 'highlight'); L.DomUtil[classFunc](this._map._container, 'coordinates-control-active'); this._map[eventFunc]('mousemove', this.onMouseMove, this); this._map[eventFunc]('contextmenu', this.onMapRightClick, this); diff --git a/src/lib/leaflet.control.locate/index.js b/src/lib/leaflet.control.locate/index.js @@ -401,16 +401,16 @@ const LocateControl = L.Control.extend({ this._stopLocating(); this._marker.removeFrom(this._map); this._setEvents(false); - this._updateButtonClasses([], ['active', 'following', 'requesting']); + this._updateButtonClasses([], ['active', 'highlight', 'following', 'requesting']); break; case STATE_ENABLED: - this._updateButtonClasses(['active'], ['following', 'requesting']); + this._updateButtonClasses(['active', 'highlight',], ['following', 'requesting']); break; case STATE_MOVING_TO_FOLLOWING_FIRST: this._marker.addTo(this._map); break; case STATE_ENABLED_FOLLOWING: - this._updateButtonClasses(['active', 'following'], ['requesting']); + this._updateButtonClasses(['active', 'highlight', 'following'], ['requesting']); break; default: } diff --git a/src/lib/leaflet.control.locate/style.css b/src/lib/leaflet.control.locate/style.css @@ -23,6 +23,3 @@ } } -.leaflet-control-locate.active a { - background-color: #cce8ff; -}