X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/783b5e3729228908d7404ae7404af1023501a906..ee4c34172f0a0145344525962cc5411a7f260ff5:/app/assets/javascripts/leaflet.sidebar.js?ds=sidebyside diff --git a/app/assets/javascripts/leaflet.sidebar.js b/app/assets/javascripts/leaflet.sidebar.js index f51aaa728..7e72278e3 100644 --- a/app/assets/javascripts/leaflet.sidebar.js +++ b/app/assets/javascripts/leaflet.sidebar.js @@ -17,6 +17,8 @@ L.OSM.sidebar = function (selector) { }; control.togglePane = function (pane, button) { + var paneWidth = 250; + current .hide() .trigger("hide"); @@ -25,12 +27,18 @@ L.OSM.sidebar = function (selector) { .removeClass("active"); if (current === pane) { + if ($("html").attr("dir") === "rtl") { + map.panBy([-paneWidth, 0], { animate: false }); + } $(sidebar).hide(); current = currentButton = $(); } else { $(sidebar).show(); current = pane; currentButton = button || $(); + if ($("html").attr("dir") === "rtl") { + map.panBy([paneWidth, 0], { animate: false }); + } } map.invalidateSize({ pan: false, animate: false });