Skip to content

Commit

Permalink
Added unminified version of Responsive Embeds script to js folder
Browse files Browse the repository at this point in the history
Responsive Embeds script in inc/enqueue-scripts.php is minified. Added
unminified version to help future development.
  • Loading branch information
alana-mullen committed Mar 22, 2017
1 parent 41ea05b commit 926836d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions js/responsive-embeds.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
jQuery(function($) {
// Add Responsive Embed to YouTube and Vimeo Embeds
$('iframe[src*="youtube.com"], iframe[src*="vimeo.com"], iframe[src*="facebook.com"]').each(function() {
if ( $(this).innerWidth() / $(this).innerHeight() > 1.5 ) {
$(this).wrap('<div class="responsive-embed widescreen"/>');
} else {
$(this).wrap('<div class="responsive-embed"/>');
}
});
});

0 comments on commit 926836d

Please sign in to comment.