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:
parent
ab0b2fb989
commit
d927e4eaf1
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user