From bfae88e60c7a623afae82e06ce1421ca778c06e7 Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Fri, 17 Mar 2017 17:19:54 +0500 Subject: Ui improvements (#5755) * PLT-5816 - Flagged posts tooltip fix * PLT-5766 - Link previews appearing outside the box * PLT-5795 - Fixing alignment user list in channel * PLT-5818 - Reset password error not aligned * PLT-5837 - Adjusting image preview max height * PLT-5778 - Updating word break for paragraphs * PLT-5848 - Updating label for file error * PLT-5846 - Markdown tables extra border on mobile * PLT-5662 - Pinned post UI improvement * Fixing eslint error * Updating tooltip eslint issue * PLT-5832 - Removing error styling on labels --- .../components/post_attachment_opengraph.jsx | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'webapp/components/post_view') diff --git a/webapp/components/post_view/components/post_attachment_opengraph.jsx b/webapp/components/post_view/components/post_attachment_opengraph.jsx index b1ebf0a4b..13171202a 100644 --- a/webapp/components/post_view/components/post_attachment_opengraph.jsx +++ b/webapp/components/post_view/components/post_attachment_opengraph.jsx @@ -32,7 +32,6 @@ export default class PostAttachmentOpenGraph extends React.Component { this.onImageLoad = this.onImageLoad.bind(this); this.onImageError = this.onImageError.bind(this); this.truncateText = this.truncateText.bind(this); - this.setImageWidth = this.setImageWidth.bind(this); } IMAGE_LOADED = { @@ -75,20 +74,16 @@ export default class PostAttachmentOpenGraph extends React.Component { componentDidMount() { OpenGraphStore.addUrlDataChangeListener(this.onOpenGraphMetadataChange); - this.setImageWidth(); - window.addEventListener('resize', this.setImageWidth); } componentDidUpdate() { if (this.props.childComponentDidUpdateFunction) { this.props.childComponentDidUpdateFunction(); } - this.setImageWidth(); } componentWillUnmount() { OpenGraphStore.removeUrlDataChangeListener(this.onOpenGraphMetadataChange); - window.removeEventListener('resize', this.setImageWidth); } onOpenGraphMetadataChange(url) { @@ -163,9 +158,6 @@ export default class PostAttachmentOpenGraph extends React.Component { return (
{ this.smallImageContainer = div; }} @@ -216,20 +208,6 @@ export default class PostAttachmentOpenGraph extends React.Component { return element; } - setImageWidth() { - if ( - this.state.imageLoaded === this.IMAGE_LOADED.YES && - this.smallImageContainer && - this.smallImageElement - ) { - this.smallImageContainer.style.width = ( - (this.smallImageElement.offsetHeight * this.imageRatio) + - this.smallImageContainerLeftPadding + - 'px' - ); - } - } - truncateText(text, maxLength = this.textMaxLenght, ellipsis = this.textEllipsis) { if (text.length > maxLength) { return text.substring(0, maxLength - ellipsis.length) + ellipsis; -- cgit v1.2.3-1-g7c22