Update Compass QoL Enhancer to 1.24.3

- Prevent clicking on a learning task from changing back to the Dashboard tab
This commit is contained in:
blankie 2023-12-04 15:39:48 +11:00
parent ed564db7fa
commit 50db62f7f5
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 5 additions and 2 deletions

View File

@ -2,7 +2,7 @@
// @name Compass QoL Enhancer
// @namespace blankie-scripts
// @match http*://*.compass.education/*
// @version 1.24.2
// @version 1.24.3
// @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
@ -109,15 +109,18 @@ if (productNavBar) {
productNavBar.style.zIndex = 20000;
}
// Prevent the dashboard tab in the user page being "dsh"
let UserProfileNewWidget = getExtClass("Compass.widgets.UserProfileNewWidget");
if (UserProfileNewWidget) {
// Prevent the dashboard tab in the user page being "dsh"
let original = UserProfileNewWidget.prototype.createItems;
UserProfileNewWidget.prototype.createItems = function() {
let res = original.apply(this, arguments);
delete res[0].listeners;
return res;
};
// Prevent clicking on a learning task from changing back to the Dashboard tab
UserProfileNewWidget.prototype.processHashChange = function() {};
}
function handleNewsItemClick(event) {