youtube in canvas [ci skip]

This commit is contained in:
danielgrippi 2012-04-21 23:06:32 -07:00
parent 265e14fb13
commit d38582c5de
3 changed files with 24 additions and 2 deletions

View file

@ -25,13 +25,15 @@ app.views.SmallFrame = app.views.Base.extend({
if(!firstPhoto ||
(firstPhoto && !firstPhoto.dimensions.height || !firstPhoto.dimensions.width)) { return className }
if(this.model.get("o_embed_cache")) {
return("x2 width")
}
return(className + ratio(firstPhoto.dimensions))
function ratio(dimensions) {
var ratio = (dimensions.width / dimensions.height)
console.log(ratio, dimensions)
if(ratio > 1.5) {
return "x2 width"
} else if(ratio < 0.75) {

View file

@ -84,6 +84,19 @@ body {
}
}
.embed-frame {
position : absolute;
top : 0;
left : 0;
width : 100%;
height : 100%;
iframe {
height : 100%;
width : 100%;
}
}
/* larger declarations */
&.x2.width .content { @include wide(); }
&.x2.height .content { @include tall(); }

View file

@ -8,6 +8,13 @@
</div>
{{/if}}
{{#if o_embed_cache.data}}
<div class="embed-frame">
{{{o_embed_cache.data.html}}}
</div>
{{/if}}
<div class="text-content">
{{{text}}}
</div>