diff --git a/src/c3nav/editor/static/editor/css/editor.scss b/src/c3nav/editor/static/editor/css/editor.scss
index 37354b36..8a0bbc3c 100644
--- a/src/c3nav/editor/static/editor/css/editor.scss
+++ b/src/c3nav/editor/static/editor/css/editor.scss
@@ -572,6 +572,7 @@ label.theme-color-label {
/* watchout for leaflet.css trying to override a:hover with a different height/width */
a.snap-toggle, a.snap-to-original-toggle {
+ background-size: 30px 30px;
display: block;
width: 30px;
height: 30px;
@@ -585,14 +586,22 @@ label.theme-color-label {
}
&.active {
- background-color: #4CAF50;
+ background-color: #45a049;
color: white;
&:hover {
- background-color: #45a049;
+ background-color: #b0ecb2;
}
}
}
+
+ /* icons */
+ a.snap-toggle {
+ background-image: url("/static/img/snap-to-edges-icon.svg");
+ }
+ a.snap-to-original-toggle {
+ background-image: url("/static/img/snap-to-original-icon.svg");
+ }
}
/* Snap indicator styles */
diff --git a/src/c3nav/editor/static/editor/js/editor.js b/src/c3nav/editor/static/editor/js/editor.js
index 32a4e7f4..396b3915 100644
--- a/src/c3nav/editor/static/editor/js/editor.js
+++ b/src/c3nav/editor/static/editor/js/editor.js
@@ -1664,8 +1664,8 @@ editor = {
},
// Snap-to-edges functionality
- _snap_enabled: true,
- _snap_to_original_enabled: true,
+ _snap_enabled: false,
+ _snap_to_original_enabled: false,
_snap_distance: 30, // pixels
_extension_area_multiplier: 4, // Extension area = snap_distance * this multiplier
_snap_to_base_map: false,
@@ -1688,7 +1688,7 @@ editor = {
snapControl.onAdd = function() {
var container = L.DomUtil.create('div', 'leaflet-bar leaflet-control leaflet-control-snap');
container.innerHTML = '⚡';
+ (editor._snap_enabled ? 'active' : '') + '"';
L.DomEvent.on(container.querySelector('.snap-toggle'), 'click', function(e) {
e.preventDefault();
@@ -1705,7 +1705,7 @@ editor = {
snapToOriginalControl.onAdd = function() {
var container = L.DomUtil.create('div', 'leaflet-bar leaflet-control leaflet-control-snap');
container.innerHTML = 'S';
+ (editor._snap_to_original_enabled ? 'active' : '') + '">';
L.DomEvent.on(container.querySelector('.snap-to-original-toggle'), 'click', function(e) {
e.preventDefault();
diff --git a/src/c3nav/static/img/snap-to-edges-icon.svg b/src/c3nav/static/img/snap-to-edges-icon.svg
new file mode 100644
index 00000000..2bc7039c
--- /dev/null
+++ b/src/c3nav/static/img/snap-to-edges-icon.svg
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/src/c3nav/static/img/snap-to-original-icon.svg b/src/c3nav/static/img/snap-to-original-icon.svg
new file mode 100644
index 00000000..938f3d3a
--- /dev/null
+++ b/src/c3nav/static/img/snap-to-original-icon.svg
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file