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