Add fitvids
This commit is contained in:
		
							parent
							
								
									9587fbce06
								
							
						
					
					
						commit
						49f33a5fe0
					
				
					 7 changed files with 114 additions and 15 deletions
				
			
		
							
								
								
									
										9
									
								
								post.hbs
									
										
									
									
									
								
							
							
						
						
									
										9
									
								
								post.hbs
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -38,6 +38,7 @@
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
{{#contentFor "scripts"}}
 | 
			
		||||
<script src="{{asset "built/jquery.fitvids.js"}}"></script>
 | 
			
		||||
<script>
 | 
			
		||||
var images = document.querySelectorAll('.kg-gallery-image img');
 | 
			
		||||
images.forEach(function (image) {
 | 
			
		||||
| 
						 | 
				
			
			@ -46,7 +47,13 @@ images.forEach(function (image) {
 | 
			
		|||
    var height = image.attributes.height.value;
 | 
			
		||||
    var ratio = width / height;
 | 
			
		||||
    container.style.flex = ratio + ' 1 0%';
 | 
			
		||||
})
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
$(document).ready(function () {
 | 
			
		||||
    // FitVids - start
 | 
			
		||||
    var $postContent = $(".gh-content");
 | 
			
		||||
    $postContent.fitVids();
 | 
			
		||||
});
 | 
			
		||||
</script>
 | 
			
		||||
{{/contentFor}}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue