From 8ba7070b02b4941520a2afc9d4ebde34c6e4d85e Mon Sep 17 00:00:00 2001 From: Michael van Schaik Date: Tue, 27 Sep 2022 06:12:48 +0200 Subject: [PATCH] Switch to listing views of subsite-filtered sections Fixes #489 --- client/javascript/LeftAndMain_Subsites.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/javascript/LeftAndMain_Subsites.js b/client/javascript/LeftAndMain_Subsites.js index 8dd2b24..4164129 100644 --- a/client/javascript/LeftAndMain_Subsites.js +++ b/client/javascript/LeftAndMain_Subsites.js @@ -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(); }); } });