Give hovered images/videos a default height.

This resolves an issue where the image may initially load off-page
and have to be re-positioned.
This commit is contained in:
Zixaphir 2015-01-16 14:51:32 -07:00
parent ab0b2fb989
commit d927e4eaf1
3 changed files with 7 additions and 1 deletions

View File

@ -12100,6 +12100,8 @@
scale = Math.min(1, maxWidth / width, maxHeight / height);
el.style.maxWidth = "" + (scale * width) + "px";
el.style.maxHeight = "" + (scale * height) + "px";
el.style.width = "" + width + "px";
el.style.height = "" + height + "px";
return UI.hover({
root: this,
el: el,

View File

@ -12123,6 +12123,8 @@
scale = Math.min(1, maxWidth / width, maxHeight / height);
el.style.maxWidth = "" + (scale * width) + "px";
el.style.maxHeight = "" + (scale * height) + "px";
el.style.width = "" + width + "px";
el.style.height = "" + height + "px";
return UI.hover({
root: this,
el: el,

View File

@ -52,8 +52,10 @@ ImageHover =
maxWidth = Math.max left, doc.clientWidth - right
maxHeight = doc.clientHeight - 16
scale = Math.min 1, maxWidth / width, maxHeight / height
el.style.maxWidth = "#{scale * width}px"
el.style.maxWidth = "#{scale * width}px"
el.style.maxHeight = "#{scale * height}px"
el.style.width = "#{width}px"
el.style.height = "#{height}px"
UI.hover
root: @
el: el