diff --git a/app/assets/javascripts/app/controllers/_application_controller_generic.coffee b/app/assets/javascripts/app/controllers/_application_controller_generic.coffee index 6c8dfa547..7234f6c92 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_generic.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_generic.coffee @@ -659,8 +659,9 @@ class App.Sidebar extends App.Controller render: => localEl = $(App.view('generic/sidebar_tabs')( - items: @items + items: @items scrollbarWidth: App.Utils.getScrollBarWidth() + dir: App.i18n.dir() )) # init content callback diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.coffee index 067618d68..7edf7bdcf 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.coffee @@ -401,6 +401,7 @@ class App.TicketZoom extends App.Controller nav: @nav isCustomer: @permissionCheck('ticket.customer') scrollbarWidth: App.Utils.getScrollBarWidth() + dir: App.i18n.dir() ) new App.TicketZoomOverviewNavigator( diff --git a/app/assets/javascripts/app/lib/bootstrap/modal.js b/app/assets/javascripts/app/lib/bootstrap/modal.js index c9ddc93dc..4e202316c 100644 --- a/app/assets/javascripts/app/lib/bootstrap/modal.js +++ b/app/assets/javascripts/app/lib/bootstrap/modal.js @@ -10,6 +10,8 @@ modified by Felix Jan-2014 - add this.$body = $(options.container || document.body) - adjustBackdrop: also adopt left, top and width from $body + modified by Felix Jul-2017 + - add rtl support */ @@ -244,6 +246,10 @@ .css('height', 0) .css('height', this.$element[0].scrollHeight) + if(App.i18n.dir() == 'rtl'){ + this.$backdrop.css('right', 'auto') + } + if(this.scrollbarWidth){ this.$backdrop.css('width', this.$body.width() - this.scrollbarWidth) } @@ -251,14 +257,22 @@ Modal.prototype.adjustDialog = function () { var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight - - this.$element.css({ + var css = { left: this.$body.offset().left, top: this.$body.offset().top, width: this.$body.width(), paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '', paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : '' - }) + } + + if(App.i18n.dir() == 'rtl'){ + css.right = 'auto' + var paddingLeft = css.paddingLeft + css.paddingLeft = css.paddingRight + css.paddingRight = paddingLeft + } + + this.$element.css(css) } Modal.prototype.resetAdjustments = function () { diff --git a/app/assets/javascripts/app/views/generic/sidebar_tabs.jst.eco b/app/assets/javascripts/app/views/generic/sidebar_tabs.jst.eco index 30a3ada73..d1bd32527 100644 --- a/app/assets/javascripts/app/views/generic/sidebar_tabs.jst.eco +++ b/app/assets/javascripts/app/views/generic/sidebar_tabs.jst.eco @@ -11,7 +11,7 @@
<% end %> -