}
if ( expandFrom === 'start' ) {
- expandFrom = docDir === 'rtl' ? 'right': 'left';
+ expandFrom = docDir === 'rtl' ? 'right' : 'left';
} else if ( expandFrom === 'end' ) {
- expandFrom = docDir === 'rtl' ? 'left': 'right';
+ expandFrom = docDir === 'rtl' ? 'left' : 'right';
}
return expandFrom;
} else {
// Expand from right
newCSS.left = 'auto';
- newCSS.right = $( document ).width() - ( context.config.$region.offset().left + context.config.$region.outerWidth() );
+ newCSS.right = $( 'body' ).width() - ( context.config.$region.offset().left + context.config.$region.outerWidth() );
}
context.data.$container.css( newCSS );