From: Andy Allan Date: Wed, 13 Nov 2024 19:15:59 +0000 (+0000) Subject: Merge pull request #5151 from AntonKhorev/no-history-and-export-buttons X-Git-Tag: live~12 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/7f611b295f39b8c42219a5ce6c84582db74ce8f7?hp=-c Merge pull request #5151 from AntonKhorev/no-history-and-export-buttons Move History and Export buttons to secondary nav --- 7f611b295f39b8c42219a5ce6c84582db74ce8f7 diff --combined app/assets/javascripts/index.js index 4dfc849fe,820c268b6..c419f9321 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@@ -1,7 -1,7 +1,7 @@@ //= require_self //= require leaflet.sidebar //= require leaflet.sidebar-pane -//= require leaflet.locatecontrol/src/L.Control.Locate +//= require leaflet.locatecontrol/dist/L.Control.Locate.umd //= require leaflet.locate //= require leaflet.layers //= require leaflet.key @@@ -25,6 -25,8 +25,6 @@@ //= require qs/dist/qs $(document).ready(function () { - var loaderTimeout; - var map = new L.OSM.Map("map", { zoomControl: false, layerControl: false, @@@ -37,7 -39,11 +37,7 @@@ map.setSidebarOverlaid(false); - clearTimeout(loaderTimeout); - - loaderTimeout = setTimeout(function () { - $("#sidebar_loader").show(); - }, 200); + $("#sidebar_loader").show().addClass("delayed-fade-in"); // IE<10 doesn't respect Vary: X-Requested-With header, so // prevent caching the XHR response as a full-page URL. @@@ -54,8 -60,9 +54,8 @@@ url: content_path, dataType: "html", complete: function (xhr) { - clearTimeout(loaderTimeout); $("#flash").empty(); - $("#sidebar_loader").hide(); + $("#sidebar_loader").removeClass("delayed-fade-in").hide(); var content = $(xhr.responseText); @@@ -405,6 -412,9 +405,9 @@@ if (OSM.router.route(this.pathname + this.search + this.hash)) { e.preventDefault(); + if (this.pathname !== "/directions") { + $("header").addClass("closed"); + } } }); diff --combined app/assets/stylesheets/common.scss index 73f8521d7,7673891eb..c4391be2d --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@@ -70,18 -70,6 +70,18 @@@ time[title] } } +/* Utility for delayed loading spinner */ + +.delayed-fade-in { + animation: 300ms linear forwards delayed-fade-in; +} + +@keyframes delayed-fade-in { + 0% { opacity: 0 } + 66% { opacity: 0 } + 100% { opacity: 1 } +} + /* Rules for the header */ #menu-icon { @@@ -131,7 -119,7 +131,7 @@@ header } nav.primary { - & > .btn-group .btn-outline-primary { + #edit_tab .btn-outline-primary { @include button-outline-variant($green, $color-hover: $white, $active-color: $white); } @@@ -209,9 -197,7 +209,7 @@@ body.small-nav } } - #sidebar .search_forms, - #edit_tab, - #export_tab { + #sidebar .search_forms { display: none; } @@@ -219,7 -205,7 +217,7 @@@ margin-right: 0; padding: 0; - .btn-group { + #edit_tab { width: 100%; padding: 10px; } @@@ -380,14 -366,6 +378,14 @@@ .leaflet-marker-draggable { cursor: move; } + + .query-marker { + animation: 1500ms forwards query-marker-fade; + + @keyframes query-marker-fade { + to { opacity: 0 } + } + } } #map-ui {