Skip to content

Commit b4db30c

Browse files
bijicurry684
authored andcommitted
fix URL state when using base href
1 parent 5cb2bbd commit b4db30c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Resources/public/js/datatables.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,12 @@
8888
var diff = data.filter(el => { return baseState.indexOf(el) === -1 && el.indexOf('time=') !== 0; });
8989
switch (config.state) {
9090
case 'fragment':
91-
history.replaceState(null, null, '#' + decodeURIComponent(diff.join('&')));
91+
history.replaceState(null, null, window.location.origin + window.location.pathname + window.location.search
92+
+ '#' + decodeURIComponent(diff.join('&')));
9293
break;
9394
case 'query':
94-
history.replaceState(null, null, '?' + decodeURIComponent(diff.join('&')));
95+
history.replaceState(null, null, window.location.origin + window.location.pathname
96+
+ '?' + decodeURIComponent(diff.join('&') + window.location.hash));
9597
break;
9698
}
9799
}

0 commit comments

Comments
 (0)