mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-22 05:15:29 +09:00
Fix doChangeLangType() redirecting to main page when short URL is used
https://xetown.com/questions/1381097
This commit is contained in:
parent
4bac63f387
commit
e33d8569bc
1 changed files with 6 additions and 2 deletions
|
|
@ -486,7 +486,7 @@ jQuery(function($) {
|
||||||
var filename = uri.filename() || 'index.php';
|
var filename = uri.filename() || 'index.php';
|
||||||
var queries = uri.search(true);
|
var queries = uri.search(true);
|
||||||
|
|
||||||
if(window.XE.isSameHost(uri.toString()) && $.isEmptyObject(queries)) {
|
if(window.XE.isSameHost(uri.toString()) && filename === 'index.php' && $.isEmptyObject(queries)) {
|
||||||
filename = '';
|
filename = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -721,7 +721,11 @@ function doChangeLangType(obj) {
|
||||||
var val = obj.options[obj.selectedIndex].value;
|
var val = obj.options[obj.selectedIndex].value;
|
||||||
setLangType(val);
|
setLangType(val);
|
||||||
}
|
}
|
||||||
|
if(location.href.match(/[?&]l=[a-z]+/)) {
|
||||||
location.href = location.href.setQuery('l', '');
|
location.href = location.href.setQuery('l', '');
|
||||||
|
} else {
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function setLangType(lang_type) {
|
function setLangType(lang_type) {
|
||||||
XE.cookie.set("lang_type", lang_type, { path: "/", expires: 3650 });
|
XE.cookie.set("lang_type", lang_type, { path: "/", expires: 3650 });
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue