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}); + }); } }