},
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 });
}
};
control.togglePane = function (pane, button) {
+ var paneWidth = 250;
+
current
.hide()
.trigger("hide");
.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 });