jQuery(document).ready(function () { jQuery('.in5-iframe-code').each(function (index, el) { var newWindow = jQuery(this).data('open-in-new-window'); var allowFull = jQuery(this).data('allow-fullscreen'); if (newWindow == 'yes' && allowFull == 'yes') { jQuery(this).closest('.in5-iframe-wrapper').prepend(jQuery('')); jQuery(this).closest('.wp-block-cgb-block-in5-wp-embed').prepend(jQuery('')); } else if (newWindow == 'yes') { jQuery(this).closest('.in5-iframe-wrapper').prepend(jQuery('')); jQuery(this).closest('.wp-block-cgb-block-in5-wp-embed').prepend(jQuery('')); } if (allowFull == 'yes') { jQuery(this).closest('.in5-iframe-wrapper').prepend(jQuery('')); jQuery(this).closest('.wp-block-cgb-block-in5-wp-embed').prepend(jQuery('')); } }); jQuery(document).on('click', '.in5-new-window', function (e) { e.preventDefault(); window.open(jQuery(this).parent().find('iframe').attr('src')); }); jQuery(document).on('click', '.in5-fullscreen', function (e) { e.preventDefault(); var element = jQuery(this).parent().find('iframe'); screenfull.request(element[0]); }); });