From 470e175c0d6b0c0b98368d727970931084e831b2 Mon Sep 17 00:00:00 2001 From: blankie Date: Wed, 11 Oct 2023 10:40:13 +1100 Subject: [PATCH] Update Compass QoL Enhancer to 1.18.1 - Fix news feed items from being expanded when attachments are clicked --- Compass QoL Enhancer.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Compass QoL Enhancer.user.js b/Compass QoL Enhancer.user.js index 4b958d2..33047fe 100644 --- a/Compass QoL Enhancer.user.js +++ b/Compass QoL Enhancer.user.js @@ -2,7 +2,7 @@ // @name Compass QoL Enhancer // @namespace blankie-scripts // @match http*://*.compass.education/* -// @version 1.18.0 +// @version 1.18.1 // @author blankie // @description A userscript that adds small but useful features for Compass, such as the ability to close windows by clicking on the background // @inject-into page @@ -71,8 +71,8 @@ if (UserProfileNewWidget) { }; } -function handleNewsItemClick() { - if (!this.moreButton.hidden) { +function handleNewsItemClick(event) { + if (!this.moreButton.hidden && event.target.localName !== "a") { Compass.saveScrollPosition(); this.expandTruncated(); } @@ -86,7 +86,7 @@ if (NewsfeedItemWidget) { this.newsItemTextContainer.events.afterrender = true; // Expand news feed items by clicking on them this.on("afterrender", function() { - this.el.on("click", handleNewsItemClick.bind(this), this.el, {single: true}); + this.el.on("click", handleNewsItemClick.bind(this), this.el); }); } }