From 48c2b7cde192c15cb429dcee7696ba4968955959 Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 5 May 2015 20:41:40 +0100 Subject: [PATCH] fixes #2570 --- src/static/js/pad.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/static/js/pad.js b/src/static/js/pad.js index a2c76c08..ade49b1e 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -456,10 +456,11 @@ var pad = { }, switchToPad: function(padId) { - var options = document.location.href.split('?')[1]; - var newHref = "/p/" + padId; - if (options != null) - newHref = newHref + '?' + options; + var newHref = new RegExp(/.*\/p\/[^\/]+/).exec(document.location.pathname) || clientVars.padId; + newHref = newHref[0]; + if (options != null){ + newHref = newHref + '?' + options; + } if(window.history && window.history.pushState) {