Twenty Fourteen: RTL for the slider.

props yoavf.
see #25801.

Built from https://develop.svn.wordpress.org/trunk@26606


git-svn-id: http://core.svn.wordpress.org/trunk@26496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-12-04 15:09:09 +00:00
parent acd61af260
commit 89cbb4405d
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 {