Merge pull request #6454 from SimonBrandner/feature/image-view-load-anim/18186
* Give lightbox a background load animation * Extends IMediaEventContent by thumbnail info * Give image view panel a loading animation * Initial implementation of loading animation * Take panel height into account * Update animation speed * Add some null guards * Fix animation issues * Move animations into _animations * Where does that magic number come from? * Remove awaiting setState() * Use CSS var in JS * Handle prefers-reduced-motion * More prefers-reduced-motion friendliness Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
@@ -117,6 +117,17 @@ export default class MImageBody extends React.Component<IBodyProps, IState> {
|
||||
params.fileSize = content.info.size;
|
||||
}
|
||||
|
||||
if (this.image.current) {
|
||||
const clientRect = this.image.current.getBoundingClientRect();
|
||||
|
||||
params.thumbnailInfo = {
|
||||
width: clientRect.width,
|
||||
height: clientRect.height,
|
||||
positionX: clientRect.x,
|
||||
positionY: clientRect.y,
|
||||
};
|
||||
}
|
||||
|
||||
Modal.createDialog(ImageView, params, "mx_Dialog_lightbox", null, true);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user