Skip to content

Commit f6dbf7c

Browse files
committed
repair link to language family to preserve the current one
1 parent 6e5c14c commit f6dbf7c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scribble-lib/scribble/scribble-common.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ function MergePageArgsIntoLink(a) {
2727

2828
function MergePageArgsIntoUrl(href) {
2929
const url = new URL(href, window.location.href);
30+
MergePageArgsIntoUrlObject(url);
31+
return url.href;
32+
}
33+
34+
function MergePageArgsIntoUrlObject(url) {
3035
for (const [key, val] of GetPageArgs()) {
3136
if (key[0] == "q") continue; // use "q" to mean "don't propagate automatcially"
3237
if (url.searchParams.has(key)) continue;
@@ -35,7 +40,6 @@ function MergePageArgsIntoUrl(href) {
3540
if (plt_root_as_query && !url.searchParams.has("PLT_Root")) {
3641
url.searchParams.append("PLT_Root", plt_root_as_query);
3742
}
38-
return url.href;
3943
}
4044

4145
// Cookies --------------------------------------------------------------------
@@ -237,6 +241,7 @@ AddOnLoad(function(){
237241
family_url = new URL(root + "family/index.html", window.location.href);
238242
}
239243
family_url.searchParams.append("qfrom", window.location.href)
244+
MergePageArgsIntoUrlObject(family_url);
240245
if (fams.indexOf(fam) == -1) {
241246
var nav_as = document.createElement('div');
242247
link.textContent = "navigating as " + fam;

0 commit comments

Comments
 (0)