We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 791a98f commit 105337fCopy full SHA for 105337f
OpenScript.js
@@ -185,7 +185,19 @@ var OpenScript = {
185
*/
186
to(path, qs = {}){
187
188
- if(path[0] != '/') path = '/' + path;
+ path = `${this.path}/${path}`.trim();
189
+
190
+ let paths = path.split('/');
191
192
+ path = '';
193
194
+ for(let p of paths) {
195
+ if(p.length === 0 || /^\s+$/.test(p)) continue;
196
197
+ if(path.length) path += '/';
198
199
+ path += p.trim();
200
+ }
201
202
let s = '';
203
@@ -196,7 +208,7 @@ var OpenScript = {
208
209
if(s.length > 0) s = `?${s}`;
210
- this.history().pushState({random: Math.random()}, '', `${path}${s}`);
211
+ this.history().pushState({random: Math.random()}, '', `/${path}${s}`);
212
this.reset.value = true;
213
214
return this.listen();
0 commit comments