Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to listing views of subsite-filtered sections #490

Merged
merged 1 commit into from Sep 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion client/javascript/LeftAndMain_Subsites.js
Expand Up @@ -7,7 +7,13 @@
$('#SubsitesSelect').entwine({
onadd:function(){
this.on('change', function(){
window.location.search=$.query.set('SubsiteID', $(this).val());
// Switch to listing views of subsite-filtered sections (eg: pages/ & assets/)
let newLocHref = window.location.href
.split('edit/show/').shift() // remove [pages/]edit/etc
.split('settings/show/').shift() // remove [pages/]settings/etc
.split('history/show/').shift() // remove [pages/]history/etc
.split('show/').shift(); // remove [assets/]show/102/edit/etc (last as 'show' is broad)
window.location.href = newLocHref + $.query.set('SubsiteID', $(this).val()).toString();
});
}
});
Expand Down