X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b70da7b8ea15ab48bb2f34155567cea6dffc8fc9..9657b92faddc9fa9bf765fc7de06aa0a9042e8e9:/app/assets/javascripts/leaflet.map.js diff --git a/app/assets/javascripts/leaflet.map.js b/app/assets/javascripts/leaflet.map.js index ffb2d7a21..105b03ed6 100644 --- a/app/assets/javascripts/leaflet.map.js +++ b/app/assets/javascripts/leaflet.map.js @@ -300,12 +300,17 @@ L.OSM.Map = L.Map.extend({ }, setSidebarOverlaid: function (overlaid) { + var sidebarWidth = 350; if (overlaid && !$("#content").hasClass("overlay-sidebar")) { $("#content").addClass("overlay-sidebar"); - this.invalidateSize({ pan: false }) - .panBy([-350, 0], { animate: false }); + this.invalidateSize({ pan: false }); + if ($("html").attr("dir") !== "rtl") { + this.panBy([-sidebarWidth, 0], { animate: false }); + } } else if (!overlaid && $("#content").hasClass("overlay-sidebar")) { - this.panBy([350, 0], { animate: false }); + if ($("html").attr("dir") !== "rtl") { + this.panBy([sidebarWidth, 0], { animate: false }); + } $("#content").removeClass("overlay-sidebar"); this.invalidateSize({ pan: false }); }