aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZog2018-02-23 10:42:23 +0100
committerZog2018-02-23 10:42:23 +0100
commit897d0ad6b48f063f40144a1dbb770f4fbc5f96f0 (patch)
tree7ab9f59addaab7ead1cd0581ba499a6ba19823e7
parent2be6e735086d08fd6f7835ce413c92c6978f01bb (diff)
downloadchouette-core-897d0ad6b48f063f40144a1dbb770f4fbc5f96f0.tar.bz2
Hide opposite routes
-rw-r--r--app/javascript/helpers/routes_map.coffee12
-rw-r--r--app/views/referential_lines/show.html.slim2
2 files changed, 11 insertions, 3 deletions
diff --git a/app/javascript/helpers/routes_map.coffee b/app/javascript/helpers/routes_map.coffee
index dea916ebd..479169995 100644
--- a/app/javascript/helpers/routes_map.coffee
+++ b/app/javascript/helpers/routes_map.coffee
@@ -35,7 +35,6 @@ RoutesLayersControl = (routes, routes_map) ->
label.innerHTML = route.name
element.appendChild label
label.addEventListener "click", =>
- console.log "click"
route.active = !route.active
$(label).toggleClass "active"
route.active
@@ -43,7 +42,16 @@ RoutesLayersControl = (routes, routes_map) ->
route.vectorEdgesLayer.setStyle routes_map.edgeStyles(route.active)
route.vectorLnsLayer.setStyle routes_map.lineStyle(route.active)
routes_map.fitZoom()
- #
+ label.addEventListener "mouseenter", =>
+ route.vectorPtsLayer.setStyle routes_map.defaultStyles(true)
+ route.vectorEdgesLayer.setStyle routes_map.edgeStyles(true)
+ route.vectorLnsLayer.setStyle routes_map.lineStyle(true)
+
+ label.addEventListener "mouseleave", =>
+ route.vectorPtsLayer.setStyle routes_map.defaultStyles(route.active)
+ route.vectorEdgesLayer.setStyle routes_map.edgeStyles(route.active)
+ route.vectorLnsLayer.setStyle routes_map.lineStyle(route.active)
+
ol.control.Control.call(this, {
element
diff --git a/app/views/referential_lines/show.html.slim b/app/views/referential_lines/show.html.slim
index 5ea0e31bb..ef32ef6b0 100644
--- a/app/views/referential_lines/show.html.slim
+++ b/app/views/referential_lines/show.html.slim
@@ -82,6 +82,6 @@
= replacement_msg t('routes.search_no_results')
= javascript_tag do
- | window.routes = "#{URI.escape(@routes.map{|r| {name: r.name, id: r.id, stops: route_json_for_edit(r, serialize: false)}}.to_json)}"
+ | window.routes = "#{URI.escape(@routes.select{|r| r.wayback == :outbound}.map{|r| {name: r.name, id: r.id, stops: route_json_for_edit(r, serialize: false)}}.to_json)}"
= javascript_pack_tag 'referential_lines/show.js'