Update Compass QoL Enhancer to 1.18.1

- Fix news feed items from being expanded when attachments are clicked
This commit is contained in:
blankie 2023-10-11 10:40:13 +11:00
parent 35268b251f
commit 470e175c0d
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 4 additions and 4 deletions

View File

@ -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);
});
}
}