diff --git a/web/src/message_list_hover.ts b/web/src/message_list_hover.ts index 1bf6100e85..0a34d47083 100644 --- a/web/src/message_list_hover.ts +++ b/web/src/message_list_hover.ts @@ -109,39 +109,6 @@ export function initialize(): void { }, ); - function handle_video_preview_mouseenter($elem: JQuery): void { - // Set image height and css vars for play button position, if not done already - const setPosition = !$elem.data("entered-before"); - if (setPosition) { - const imgW = $elem.find("img")[0]!.width; - const imgH = $elem.find("img")[0]!.height; - // Ensure height doesn't change on mouse enter - $elem.css("height", `${imgH}px`); - // variables to set play button position - const marginLeft = (imgW - 30) / 2; - const marginTop = (imgH - 26) / 2; - $elem.css("--margin-left", `${marginLeft}px`).css("--margin-top", `${marginTop}px`); - $elem.data("entered-before", true); - } - $elem.addClass("fa fa-play"); - } - - $("#main_div").on("mouseenter", ".youtube-video a", function (this: HTMLElement) { - handle_video_preview_mouseenter($(this)); - }); - - $("#main_div").on("mouseleave", ".youtube-video a", function () { - $(this).removeClass("fa fa-play"); - }); - - $("#main_div").on("mouseenter", ".embed-video a", function (this: HTMLElement) { - handle_video_preview_mouseenter($(this)); - }); - - $("#main_div").on("mouseleave", ".embed-video a", function () { - $(this).removeClass("fa fa-play"); - }); - $("body").on("mouseover", ".message_edit_content", function () { $(this).closest(".message_row").find(".copy_message").show(); }); diff --git a/web/styles/rendered_markdown.css b/web/styles/rendered_markdown.css index 0368374afb..2c64e0ca74 100644 --- a/web/styles/rendered_markdown.css +++ b/web/styles/rendered_markdown.css @@ -606,7 +606,8 @@ } .message_inline_video, - .message_inline_animated_image_still { + .message_inline_animated_image_still, + .youtube-video a[data-id] { &:hover { &::after { transform: scale(1); @@ -638,20 +639,6 @@ } } - .youtube-video .fa-play::before, - .embed-video .fa-play::before { - position: absolute; - margin: var(--margin-top, 32px) 0 0 var(--margin-left, 45px); - padding: 5px 8px 5px 10px; - font-size: 12px; - border-radius: 4px; - background-color: hsl(0deg 0% 0%); - color: hsl(0deg 0% 100%); - opacity: 0.7; - top: 0; - left: 0; - } - .message_embed { display: block; position: relative;