From 0b42712a1f0fb0612fd2d111af5279c39f932ba2 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Thu, 3 Dec 2015 17:37:00 -0800 Subject: [PATCH] Fix moving of query behind hash --- client/commonFramework/code-uri.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/client/commonFramework/code-uri.js b/client/commonFramework/code-uri.js index e676f3ff11..3051c12bd2 100644 --- a/client/commonFramework/code-uri.js +++ b/client/commonFramework/code-uri.js @@ -105,12 +105,17 @@ window.common = (function(global) { return null; } 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.state, null, - '#?solution=' + - codeUri.encode(encodeFcc(solution)) + - (codeUri.shouldRun() ? '&run=disabled' : '' ) + url + + '#?' + + (codeUri.shouldRun() ? '' : 'run=disabled&') + + 'solution=' + + codeUri.encode(encodeFcc(solution)) ); } else { location.hash = '?solution=' +