mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-07 15:40:14 -05:00
Allow users to open Settings and specific tabs from a URL
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user