mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
Merge pull request #490 from micschk/patch-1
Switch to listing views of subsite-filtered sections
This commit is contained in:
commit
4049f7a12d
@ -7,7 +7,13 @@
|
|||||||
$('#SubsitesSelect').entwine({
|
$('#SubsitesSelect').entwine({
|
||||||
onadd:function(){
|
onadd:function(){
|
||||||
this.on('change', 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();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user