Allow users to open Settings and specific tabs from a URL

This commit is contained in:
jelveh
2025-05-17 12:30:27 -07:00
parent 7823fdfab0
commit a1b96b7130
2 changed files with 13 additions and 1 deletions
@@ -118,6 +118,17 @@ async function UIWindowSettings(options){
}
});
// If options.tab is provided, open that tab
if (options.tab) {
const $tabToOpen = $el_window.find(`.settings-sidebar-item[data-settings="${options.tab}"]`);
if ($tabToOpen.length > 0) {
console.log('tabToOpen', $tabToOpen);
setTimeout(() => {
$tabToOpen.trigger('click');
}, 50);
}
}
$(el_window).on('click', '.settings-sidebar-item', function(){
const $this = $(this);
const settings = $this.attr('data-settings');
+2 -1
View File
@@ -1249,8 +1249,9 @@ async function UIDesktop(options) {
else if (window.url_paths[0]?.toLocaleLowerCase() === 'settings') {
// open settings
UIWindowSettings({
tab: window.url_paths[1] || 'about',
window_options: {
// is_fullpage: true,
is_fullpage: true,
}
});
}