commit 369dd570de9de31f1b88b4ef2d6c16e5ca86a073
parent bd99dd192344a089f5aa1cb7c5d2009881c691ef
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Mon, 21 Nov 2016 00:37:40 +0300
[coordinates control] moved style for button-like controls to common styles file
Diffstat:
3 files changed, 26 insertions(+), 12 deletions(-)
diff --git a/src/lib/controls-styles.css b/src/lib/controls-styles.css
@@ -41,4 +41,20 @@
line-height: 26px;
font-weight: bold;
color: #333;
-}
-\ No newline at end of file
+}
+
+.leaflet-contol-button {
+ display: inline-block;
+ width: 26px;
+ height: 26px;
+ background-position: 50% 50%;
+ background-repeat: no-repeat;
+ border-radius: 4px;
+ background-color: white;
+ box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
+ cursor: pointer;
+}
+
+.leaflet-contol-button:hover {
+ background-color: #f4f4f4;
+}
diff --git a/src/lib/leaflet.control.coordinates/coordinates.css b/src/lib/leaflet.control.coordinates/coordinates.css
@@ -1,14 +1,5 @@
.leaflet-control-coordinates {
- display: inline-block;
- width: 26px;
- height: 26px;
- background-position: 50% 50%;
- background-repeat: no-repeat;
background-image: url('coords16.png');
- border-radius: 4px;
- background-color: white;
- box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
- cursor: pointer;
}
.leaflet-control-coordinates.expanded {
@@ -18,6 +9,10 @@
overflow: hidden;
}
+.leaflet-control-coordinates.expanded:hover {
+ background-color: white;
+}
+
.leaflet-control-coordinates-text {
display: none;
white-space: nowrap;
diff --git a/src/lib/leaflet.control.coordinates/coordinates.js b/src/lib/leaflet.control.coordinates/coordinates.js
@@ -22,7 +22,11 @@ L.Control.Coordinates = L.Control.extend({
onAdd: function(map) {
this._map = map;
- var container = this._container = L.DomUtil.create('div', 'leaflet-control leaflet-control-coordinates');
+ var container = this._container = L.DomUtil.create('div', 'leaflet-control leaflet-contol-button leaflet-control-coordinates');
+ L.DomEvent.disableClickPropagation(container);
+ if (!L.Browser.touch) {
+ L.DomEvent.disableScrollPropagation(container);
+ }
this._field_lat = L.DomUtil.create('div', 'leaflet-control-coordinates-text', container);
this._field_lon = L.DomUtil.create('div', 'leaflet-control-coordinates-text', container);
L.DomEvent