Twenty Fourteen: RTL for the slider.

props yoavf.
see #25801.


git-svn-id: https://develop.svn.wordpress.org/trunk@26606 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-12-04 15:08:32 +00:00
parent 0b6e655a2d
commit aa8baaabf5
1 changed files with 7 additions and 0 deletions

View File

@ -37,6 +37,7 @@
slider.container = $( slider.containerSelector, slider ); slider.container = $( slider.containerSelector, slider );
slider.count = slider.slides.length; slider.count = slider.slides.length;
slider.prop = 'marginLeft'; slider.prop = 'marginLeft';
slider.isRtl = $( 'body' ).hasClass( 'rtl' );
slider.args = {}; slider.args = {};
// TOUCH // TOUCH
slider.transitions = ( function() { slider.transitions = ( function() {
@ -445,6 +446,12 @@
slider.getTarget = function( dir ) { slider.getTarget = function( dir ) {
slider.direction = dir; slider.direction = dir;
// Swap for RTL.
if ( slider.isRtl ) {
dir = 'next' === dir ? 'prev' : 'next';
}
if ( dir === 'next' ) { if ( dir === 'next' ) {
return ( slider.currentSlide === slider.last ) ? 0 : slider.currentSlide + 1; return ( slider.currentSlide === slider.last ) ? 0 : slider.currentSlide + 1;
} else { } else {