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);
|
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,
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
@ -52,8 +52,10 @@ ImageHover =
|
|||||||
maxWidth = Math.max left, doc.clientWidth - right
|
maxWidth = Math.max left, doc.clientWidth - right
|
||||||
maxHeight = doc.clientHeight - 16
|
maxHeight = doc.clientHeight - 16
|
||||||
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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user