From 9b9ba9c33c6e46afd3cf1fcbc901ade03ed95d57 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sat, 9 Aug 2014 19:52:57 +0200 Subject: [PATCH] Added flash size constraining --- public_html/media/js/post-view.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/public_html/media/js/post-view.js b/public_html/media/js/post-view.js index e12a72a5..1f71b0cc 100644 --- a/public_html/media/js/post-view.js +++ b/public_html/media/js/post-view.js @@ -1,7 +1,21 @@ +function constrainFlashSize() +{ + var target = $('.post-type-flash object'); + var container = $('#inner-content'); + target.width(''); + if (target.width() > container.width()) + { + target.width(container.width()) + target.height(container.width() * target.attr('height') / target.attr('width')); + } +} + $(function() { function onDomUpdate() { + constrainFlashSize(); + $('#sidebar .permalink').bindOnce('select-link', 'click', function(e) { e.preventDefault();