Update Compass QoL Enhancer to 1.13.2
- Fix getting the correct tab to open from the URL
This commit is contained in:
parent
b251d9c2e5
commit
2e251efbdf
|
@ -2,7 +2,7 @@
|
|||
// @name Compass QoL Enhancer
|
||||
// @namespace blankie-scripts
|
||||
// @match http*://*.compass.education/*
|
||||
// @version 1.13.1
|
||||
// @version 1.13.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
|
||||
|
@ -223,6 +223,7 @@ function handleNewCalendarEvent(element, calendar) {
|
|||
function handlePanelItem(panel, panelItem, isDefault, tabToOpen) {
|
||||
let panelId = panelItem.itemId || panelItem.id;
|
||||
let panelItemHash = getPanelItemHash(panelId, isDefault);
|
||||
|
||||
// Automatically open tab specified in fragment
|
||||
if (panelId === tabToOpen) {
|
||||
// if the sessions tab is automatically opened, the currently selected tab is still dashboard for some reason,
|
||||
|
@ -331,7 +332,7 @@ function handleNewNode(node, observer) {
|
|||
let panel = unsafeWindow.Ext.getCmp(topMostPanel.id);
|
||||
let tabToOpen = window.location.pathname === "/Organise/Activities/Activity.aspx"
|
||||
? getHashSearch().get("qol_open_tab")
|
||||
: (window.location.hash.replace(/^#(.+?)&.*$/, "$1") || null);
|
||||
: (window.location.hash.replace(/^#(.+?)(?:&.*)?$/, "$1") || null);
|
||||
for (let i = 0; i < panel.items.items.length; i++) {
|
||||
handlePanelItem(panel, panel.items.items[i], i === 0, tabToOpen);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue