From 66c64230013c2100285d742a0648d359a668066e Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Mon, 11 Feb 2019 21:57:45 +0000 Subject: [PATCH] popovers: Restructure hardcoded "top" for user popover. The patch to bootstrap will make the position smarter, but we still want to preserve the 100px default vertical offset we chose for visual reasons. Tweaked by tabbott to preserve the visual design. --- static/js/popovers.js | 1 + static/styles/popovers.scss | 1 - static/third/bootstrap/js/bootstrap.js | 3 +++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/static/js/popovers.js b/static/js/popovers.js index 0d23f2b1a3..84497b9864 100644 --- a/static/js/popovers.js +++ b/static/js/popovers.js @@ -162,6 +162,7 @@ function render_user_info_popover(user, popover_element, is_sender_popover, priv {user_avatar: "avatar/" + user.email, user_is_guest: user.is_guest}), trigger: "manual", + top_offset: 100, }); popover_element.popover("show"); diff --git a/static/styles/popovers.scss b/static/styles/popovers.scss index d6f9f63ee1..2cf92c81f7 100644 --- a/static/styles/popovers.scss +++ b/static/styles/popovers.scss @@ -92,7 +92,6 @@ ul.remind_me_popover .remind_icon { .user_popover { width: 240px; - top: 100px !important; margin: -14px; padding: 0; diff --git a/static/third/bootstrap/js/bootstrap.js b/static/third/bootstrap/js/bootstrap.js index 3d1d974014..901339b02c 100644 --- a/static/third/bootstrap/js/bootstrap.js +++ b/static/third/bootstrap/js/bootstrap.js @@ -1262,6 +1262,9 @@ break case 'left': top = pos.top + pos.height / 2 - actualHeight / 2; + if (this.options.top_offset) { + top = this.options.top_offset; + } left = pos.left - actualWidth; break case 'right':