From d8b7be45b597496e83daf3368d56cce70b15240d Mon Sep 17 00:00:00 2001 From: blankie Date: Fri, 10 Nov 2023 11:38:48 +1100 Subject: [PATCH] Update Compass QoL Enhancer to 1.24.1 - Fix error when getting the title of a header-less window - Fix news item expanding when an attached image is opened --- Compass QoL Enhancer.user.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Compass QoL Enhancer.user.js b/Compass QoL Enhancer.user.js index 7301e8b..c7cf3ae 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.24.0 +// @version 1.24.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 @@ -120,7 +120,7 @@ if (UserProfileNewWidget) { } function handleNewsItemClick(event) { - if (!this.moreButton.hidden && event.target.localName !== "a") { + if (!this.moreButton.hidden && !event.target.closest("a, .newsfeed-image")) { Compass.saveScrollPosition(); this.expandTruncated(); } @@ -578,8 +578,12 @@ function handleNewNode(node, observer) { handleLearningTasksTable(node); } else if (node.classList.contains("x-grid-view") && unsafeWindow.Ext.getCmp(node.id).up("#submissionsPanel")) { handleLearningTaskSubmissionTable(node); - } else if (node.classList.contains("x-window") && node.querySelector(".x-window-header-text").textContent.startsWith("View Permissions for ")) { - handlePermissionsWindow(node); + } else if (node.classList.contains("x-window")) { + let titleElement = node.querySelector(".x-window-header-text"); + let title = titleElement ? titleElement.textContent : ""; + if (title.startsWith("View Permissions for ")) { + handlePermissionsWindow(node); + } } if (node.classList.contains("cke")) {