Update Compass QoL Enhancer to 1.17.2

- Fix viewing wiki on /Communicate/SchoolDocumentation.aspx
This commit is contained in:
blankie 2023-10-04 13:01:03 +11:00
parent 728e07e816
commit 88315b095b
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 6 additions and 4 deletions

View File

@ -2,7 +2,7 @@
// @name Compass QoL Enhancer
// @namespace blankie-scripts
// @match http*://*.compass.education/*
// @version 1.17.1
// @version 1.17.2
// @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
@ -229,10 +229,12 @@ function wikiNodeSort(lhs, rhs) {
}
let WikiBrowserPanel = getExtClass("Compass.widgets.WikiBrowserPanel");
if (WikiBrowserPanel) {
let original = WikiBrowserPanel.prototype.renderLayout;
WikiBrowserPanel.prototype.renderLayout = function() {
let original = WikiBrowserPanel.prototype.initComponent;
WikiBrowserPanel.prototype.initComponent = function() {
original.apply(this, arguments);
this.treePanel.store.sort({sorterFn: wikiNodeSort});
this.on("treeDataLoaded", function() {
this.treePanel.store.sort({sorterFn: wikiNodeSort});
});
}
}