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
This commit is contained in:
blankie 2023-11-10 11:38:48 +11:00
parent c13f837c62
commit d8b7be45b5
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 8 additions and 4 deletions

View File

@ -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")) {