From: Anton Khorev Date: Mon, 3 Jun 2024 09:21:11 +0000 (+0300) Subject: Use flex in routing form to fix marker column width X-Git-Tag: live~457^2~2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/6ae4e53f4582f91267ec829a5b6cb1b2260aa06b?ds=inline;hp=--cc Use flex in routing form to fix marker column width --- 6ae4e53f4582f91267ec829a5b6cb1b2260aa06b diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 89eccb8cb..f6b0581ca 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -357,7 +357,7 @@ OSM.Directions = function (map) { getRoute(true, true); }); - $(".routing_marker").on("dragstart", function (e) { + $(".routing_marker_column img").on("dragstart", function (e) { var dt = e.originalEvent.dataTransfer; dt.effectAllowed = "move"; var dragData = { type: $(this).data("type") }; diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 757da56fe..4cc31d611 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -568,7 +568,13 @@ tr.turn { cursor: pointer; } -.routing_marker { width: 15px; cursor: move; } +.routing_marker_column { + width: 15px; + + img { + cursor: move; + } +} /* Rules for the history sidebar */ diff --git a/app/views/layouts/_search.html.erb b/app/views/layouts/_search.html.erb index 11b7c7b1e..00cf60b7a 100644 --- a/app/views/layouts/_search.html.erb +++ b/app/views/layouts/_search.html.erb @@ -33,34 +33,26 @@
-
-
- <%= image_tag "marker-green.png", :class => "routing_marker mx-auto d-block", :data => { :type => "from" }, :draggable => "true" %> -
-
- <%= text_field_tag "route_from", params[:from], :placeholder => t("site.search.from"), :autocomplete => "on", :class => "form-control py-1 px-2", :dir => "auto" %> +
+
+ <%= image_tag "marker-green.png", :class => "img-fluid", :data => { :type => "from" }, :draggable => "true" %>
+ <%= text_field_tag "route_from", params[:from], :placeholder => t("site.search.from"), :autocomplete => "on", :class => "form-control py-1 px-2", :dir => "auto" %>
-
-
- <%= image_tag "marker-red.png", :class => "routing_marker mx-auto d-block", :data => { :type => "to" }, :draggable => "true" %> -
-
- <%= text_field_tag "route_to", params[:to], :placeholder => t("site.search.to"), :autocomplete => "on", :class => "form-control py-1 px-2", :dir => "auto" %> +
+
+ <%= image_tag "marker-red.png", :class => "img-fluid", :data => { :type => "to" }, :draggable => "true" %>
+ <%= text_field_tag "route_to", params[:to], :placeholder => t("site.search.to"), :autocomplete => "on", :class => "form-control py-1 px-2", :dir => "auto" %>
-
-
- -
-
- <%= submit_tag t("site.search.submit_text"), :class => "routing_go btn btn-primary py-1 px-2", :data => { :disable_with => false } %> -
+
+
+ + <%= submit_tag t("site.search.submit_text"), :class => "routing_go btn btn-primary py-1 px-2", :data => { :disable_with => false } %>
-
-
- -
+
+
+