youtube in canvas [ci skip]
This commit is contained in:
parent
265e14fb13
commit
d38582c5de
3 changed files with 24 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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(); }
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in a new issue