Fix moving of query behind hash
This commit is contained in:
@ -105,12 +105,17 @@ window.common = (function(global) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (history && typeof history.replaceState === 'function') {
|
if (history && typeof history.replaceState === 'function') {
|
||||||
|
// grab the url up to the query
|
||||||
|
// destroy any hash symbols still clinging to life
|
||||||
|
const url = (location.href.split('?')[0]).replace(/(#*)$/, '');
|
||||||
history.replaceState(
|
history.replaceState(
|
||||||
history.state,
|
history.state,
|
||||||
null,
|
null,
|
||||||
'#?solution=' +
|
url +
|
||||||
codeUri.encode(encodeFcc(solution)) +
|
'#?' +
|
||||||
(codeUri.shouldRun() ? '&run=disabled' : '' )
|
(codeUri.shouldRun() ? '' : 'run=disabled&') +
|
||||||
|
'solution=' +
|
||||||
|
codeUri.encode(encodeFcc(solution))
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
location.hash = '?solution=' +
|
location.hash = '?solution=' +
|
||||||
|
Reference in New Issue
Block a user