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); 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.maxHeight = "" + (scale * height) + "px";
el.style.width = "" + width + "px";
el.style.height = "" + height + "px";
return UI.hover({ return UI.hover({
root: this, root: this,
el: el, el: el,

View File

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

View File

@ -54,6 +54,8 @@ ImageHover =
scale = Math.min 1, maxWidth / width, maxHeight / height 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.maxHeight = "#{scale * height}px"
el.style.width = "#{width}px"
el.style.height = "#{height}px"
UI.hover UI.hover
root: @ root: @
el: el el: el