From 4c0e2c61104be429961ee7c9430adf79dfbb3b88 Mon Sep 17 00:00:00 2001 From: "Amir E. Aharoni" Date: Sat, 22 Dec 2012 00:41:15 +0200 Subject: [PATCH] (bug 24692) Make the padding support RTL languages Change-Id: I5be38f001dcc13a57e213fdbb505f05623070af3 --- resources/jquery/jquery.arrowSteps.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/resources/jquery/jquery.arrowSteps.js b/resources/jquery/jquery.arrowSteps.js index 488d106511..a1fd679d42 100644 --- a/resources/jquery/jquery.arrowSteps.js +++ b/resources/jquery/jquery.arrowSteps.js @@ -42,18 +42,21 @@ */ ( function ( $ ) { $.fn.arrowSteps = function () { - var $steps, width, arrowWidth; + var $steps, width, arrowWidth, + paddingSide = $( 'body' ).hasClass( 'rtl' ) ? 'padding-left' : 'padding-right'; + this.addClass( 'arrowSteps' ); $steps = this.find( 'li' ); width = parseInt( 100 / $steps.length, 10 ); $steps.css( 'width', width + '%' ); - // every step except the last one has an arrow at the right hand side. Also add in the padding - // for the calculated arrow width. + // Every step except the last one has an arrow pointing forward: + // at the right hand side in LTR languages, and at the left hand side in RTL. + // Also add in the padding for the calculated arrow width. arrowWidth = parseInt( this.outerHeight(), 10 ); $steps.filter( ':not(:last-child)' ).addClass( 'arrow' ) - .find( 'div' ).css( 'padding-right', arrowWidth.toString() + 'px' ); + .find( 'div' ).css( paddingSide, arrowWidth.toString() + 'px' ); this.data( 'arrowSteps', $steps ); return this; -- 2.20.1