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:
parent
0b6e655a2d
commit
aa8baaabf5
|
@ -37,6 +37,7 @@
|
|||
slider.container = $( slider.containerSelector, slider );
|
||||
slider.count = slider.slides.length;
|
||||
slider.prop = 'marginLeft';
|
||||
slider.isRtl = $( 'body' ).hasClass( 'rtl' );
|
||||
slider.args = {};
|
||||
// TOUCH
|
||||
slider.transitions = ( function() {
|
||||
|
@ -445,6 +446,12 @@
|
|||
|
||||
slider.getTarget = function( dir ) {
|
||||
slider.direction = dir;
|
||||
|
||||
// Swap for RTL.
|
||||
if ( slider.isRtl ) {
|
||||
dir = 'next' === dir ? 'prev' : 'next';
|
||||
}
|
||||
|
||||
if ( dir === 'next' ) {
|
||||
return ( slider.currentSlide === slider.last ) ? 0 : slider.currentSlide + 1;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue