Skip to content

Instantly share code, notes, and snippets.

@mohamedsalehamin
Forked from aliaghdam/visual-composer-rtl-fix.js
Created August 23, 2017 22:40
Show Gist options
  • Save mohamedsalehamin/ac8a0b00bebf20ee9bf736a8167091ff to your computer and use it in GitHub Desktop.
Save mohamedsalehamin/ac8a0b00bebf20ee9bf736a8167091ff to your computer and use it in GitHub Desktop.
WordPress Visual Composer full width row ( stretche row ) fix for RTL
jQuery(document).ready(function() {
function bs_fix_vc_full_width_row(){
var $elements = jQuery('[data-vc-full-width="true"]');
jQuery.each($elements, function () {
var $el = jQuery(this);
$el.css('right', $el.css('left')).css('left', '');
});
}
// Fixes rows in RTL
jQuery(document).on('vc-full-width-row', function () {
bs_fix_vc_full_width_row();
});
// Run one time because it was not firing in Mac/Firefox and Windows/Edge some times
bs_fix_vc_full_width_row();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment