MediaWiki:Common.js: Difference between revisions
MediaWiki interface page
More actions
m +audio |
m derp |
||
| Line 177: | Line 177: | ||
obj.children('embed').attr('width', width).attr('height', youtubeHelper.chromeSize); // Set <embed> height | obj.children('embed').attr('width', width).attr('height', youtubeHelper.chromeSize); // Set <embed> height | ||
} | } | ||
var ratio = youtubeHelper.ratioR.exec($(youtube).attr('class')); | else { | ||
var ratio = youtubeHelper.ratioR.exec($(youtube).attr('class')); | |||
if(ratio != null) { | |||
ratio = parseFloat(ratio[1])/parseFloat(ratio[2]); | |||
var newHeight = Math.round(width / ratio + youtubeHelper.chromeSize).toString(); | |||
obj.attr('width', width).attr('height', newHeight); // Set <object> height | |||
obj.children('embed').attr('width', width).attr('height', newHeight); // Set <embed> height | |||
} | |||
} | } | ||
}, | }, | ||