From 88315b095b329edc1373287073c3eda371d30af2 Mon Sep 17 00:00:00 2001 From: blankie Date: Wed, 4 Oct 2023 13:01:03 +1100 Subject: [PATCH] Update Compass QoL Enhancer to 1.17.2 - Fix viewing wiki on /Communicate/SchoolDocumentation.aspx --- Compass QoL Enhancer.user.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Compass QoL Enhancer.user.js b/Compass QoL Enhancer.user.js index ae9ce2b..fd6e369 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.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}); + }); } }