Permalink
Browse files

Also resize <object> tags if present

  • Loading branch information...
1 parent ef9f235 commit 9d10f007a05e52fa244a120bd8a8bb4ef2440552 @Seldaek Seldaek committed Jul 4, 2010
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/slippy-0.9.0.js
View
@@ -85,7 +85,7 @@
return Math.round(ratio * slideW * 0.9);
});
$('embed').each(function() {
- var ratio, imgWidth, newWidth, $el, $parent;
+ var ratio, imgWidth, newWidth, $el, $parent, $object;
$el = $(this);
if (!$el.parent().hasClass('embedWrapper')) {
$el.wrap($('<div/>').addClass('embedWrapper'));
@@ -101,6 +101,11 @@
newWidth = Math.round(ratio * slideW * 0.9);
$el.attr('height', Math.round(newWidth * $parent.data('origRatio')));
$el.attr('width', newWidth);
+ $object = $el.closest('object');
+ if ($object.length > 0) {
+ $object.attr('height', Math.round(newWidth * $parent.data('origRatio')));
+ $object.attr('width', newWidth);
+ }
});
resizeOverview();
centerVertically();

0 comments on commit 9d10f00

Please sign in to comment.