File tree 1 file changed +20
-16
lines changed
1 file changed +20
-16
lines changed Original file line number Diff line number Diff line change @@ -349,28 +349,32 @@ document.addEventListener('change', function(e) {
349
349
350
350
351
351
window . datagridSerializeUrl = function ( obj , prefix ) {
352
- var str = [ ] ;
353
- for ( var p in obj ) {
354
- if ( obj . hasOwnProperty ( p ) ) {
355
- var k = prefix ? prefix + "[" + p + "]" : p , v = obj [ p ] ;
356
- if ( v !== null && v !== "" ) {
357
- if ( window . location . pathname . includes ( '/' + v ) ) {
358
- continue ;
359
- }
360
- if ( typeof v == "object" ) {
361
- var r = window . datagridSerializeUrl ( v , k ) ;
352
+ const str = [ ] ;
353
+ let urlPathForPersistentChecking = window . location . pathname ;
354
+
355
+ for ( const p in obj ) {
356
+ if ( obj . hasOwnProperty ( p ) ) {
357
+ const k = prefix ? prefix + "[" + p + "]" : p , v = obj [ p ] ;
358
+ if ( v !== null && v !== "" ) {
359
+ // fix for persistent nette parameters
360
+ if ( urlPathForPersistentChecking . includes ( '/' + v ) ) {
361
+ urlPathForPersistentChecking = urlPathForPersistentChecking . replace ( '/' + v , '' ) ;
362
+ continue ;
363
+ }
364
+ if ( typeof v == "object" ) {
365
+ const r = window . datagridSerializeUrl ( v , k ) ;
362
366
if ( r ) {
363
367
str . push ( r ) ;
364
368
}
365
- } else {
366
- str . push ( encodeURIComponent ( k ) + "=" + encodeURIComponent ( v ) ) ;
369
+ } else {
370
+ str . push ( encodeURIComponent ( k ) + "=" + encodeURIComponent ( v ) ) ;
371
+ }
367
372
}
368
373
}
369
374
}
370
- }
371
- return str . join ( "&" ) ;
372
- }
373
- ;
375
+
376
+ return str . join ( "&" ) ;
377
+ } ;
374
378
375
379
datagridSortable = function ( ) {
376
380
if ( typeof $ . fn . sortable === 'undefined' ) {
You can’t perform that action at this time.
0 commit comments