From 9fc7435ea2ef7af161fadf4b3f9abc4a4aadcb73 Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Tue, 6 Mar 2018 10:47:53 +0000 Subject: [PATCH] Correctly position tooltips relative to parent element. --- src/components/views/rooms/RoomTooltip.js | 2 +- .../views/messages/_MImageBody.scss | 17 ++++++++--------- .../vector-web/views/rooms/_RoomTooltip.scss | 3 ++- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/views/rooms/RoomTooltip.js b/src/components/views/rooms/RoomTooltip.js index 714d57ca24..518ceacc4c 100644 --- a/src/components/views/rooms/RoomTooltip.js +++ b/src/components/views/rooms/RoomTooltip.js @@ -66,7 +66,7 @@ module.exports = React.createClass({ // positioned, also taking into account any window zoom // NOTE: The additional 6 pixels for the left position, is to take account of the // tooltips chevron - var parent = ReactDOM.findDOMNode(this); + var parent = ReactDOM.findDOMNode(this).parentNode; var style = {}; style.top = parent.getBoundingClientRect().top + window.pageYOffset; style.left = 6 + parent.getBoundingClientRect().right + window.pageXOffset; diff --git a/src/skins/vector/css/matrix-react-sdk/views/messages/_MImageBody.scss b/src/skins/vector/css/matrix-react-sdk/views/messages/_MImageBody.scss index 1702aac8ad..9d26cacbff 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/messages/_MImageBody.scss +++ b/src/skins/vector/css/matrix-react-sdk/views/messages/_MImageBody.scss @@ -15,15 +15,14 @@ limitations under the License. */ .mx_MImageBody { - display: block; - margin-right: 34px; + display: block; + margin-right: 34px; } -.mx_MImageBody_thumbnail { - max-width: 100%; -/* - background-color: $primary-bg-color; - border: 2px solid $primary-bg-color; - border-radius: 1px; -*/ +.mx_MImageBody_thumbnail_container { + display: inline-block; +} + +img.mx_MImageBody_thumbnail { + max-width: 100%; } diff --git a/src/skins/vector/css/vector-web/views/rooms/_RoomTooltip.scss b/src/skins/vector/css/vector-web/views/rooms/_RoomTooltip.scss index 5469a9e6d3..9988425b8f 100644 --- a/src/skins/vector/css/vector-web/views/rooms/_RoomTooltip.scss +++ b/src/skins/vector/css/vector-web/views/rooms/_RoomTooltip.scss @@ -49,5 +49,6 @@ limitations under the License. line-height: 14px; font-size: 13px; color: $primary-fg-color; + max-width: 600px; + margin-right: 50px; } -