-
AuthorPosts
-
July 11, 2014 at 8:46 pm #290249
Hey there! I know the theme supports RTL, but it uses the Isotope v2 script and in order for it to support RTL you have to add the following code only on RTL layouts:
isOriginLeft: false
source: http://isotope.metafizzy.co/options.html#isoriginleft
But where should I add it on my child theme?
July 11, 2014 at 11:53 pm #290311Hey!
Copy js/avia.js to your child theme folder and add this to the child functions.php:
function wp_change_aviajs() { wp_dequeue_script( 'avia-default' ); wp_enqueue_script( 'avia-default-child', get_stylesheet_directory_uri().'/js/avia.js', array('jquery'), 2, true ); } add_action( 'wp_print_scripts', 'wp_change_aviajs', 100 );
The RTL setting is set in line 1107:
layoutMode : 'fitRows', itemSelector : '.flex_column', isOriginLeft: false
Cheers!
JosueJuly 12, 2014 at 2:09 am #290353Thanks!
To make it work, I had to do further mods.
1.) I removed the minified isotope.js on avia.js
2.) d/l isotope.pkgd.js
3.) load it on the function you gave me:function wp_change_aviajs() { wp_dequeue_script( 'avia-default' ); wp_enqueue_script( 'avia-default-child', get_stylesheet_directory_uri().'/js/avia.js', array('jquery'), 2, true ); wp_enqueue_script( 'isotope-child', get_stylesheet_directory_uri().'/js/isotope.pkgd.js', array('jquery'), 2, true ); } if (is_rtl()): add_action( 'wp_print_scripts', 'wp_change_aviajs', 100 ); endif;
4.) on line 1815, change default from true to false
// default options Outlayer.defaults = { containerStyle: { position: 'relative' }, isInitLayout: true, isOriginLeft: false, isOriginTop: true, isResizeBound: true, isResizingContainer: true, // item options transitionDuration: '0.4s', hiddenStyle: { opacity: 0, transform: 'scale(0.001)' }, visibleStyle: { opacity: 1, transform: 'scale(1)' } };
5.) on avia.js (line 1130) I’ve added the code “isOriginLeft: false”:
container.isotope({ layoutMode : 'fitRows', itemSelector : '.flex_column' , filter: '.'+selector, isOriginLeft: false}, function()
Thanks!July 12, 2014 at 2:14 am #290358Great, that’s a way better solution, thanks for sharing it :)
Regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.