File tree Expand file tree Collapse file tree 1 file changed +28
-13
lines changed
Expand file tree Collapse file tree 1 file changed +28
-13
lines changed Original file line number Diff line number Diff line change 22 * File: ReportAdmin.js
33 */
44
5- ( function ( $ ) {
6- $ . entwine ( 'ss' , function ( $ ) {
7- $ ( '.ReportAdmin .cms-edit-form' ) . entwine ( {
8- onsubmit : function ( e ) {
9- var url = $ . path . parseUrl ( document . location . href ) . hrefNoSearch ,
10- params = this . find ( ':input[name^=filters]' ) . serializeArray ( ) ;
11- params = $ . grep ( params , function ( param ) { return ( param . value ) ; } ) ; // filter out empty
12- if ( params ) url = $ . path . addSearchParams ( url , $ . param ( params ) ) ;
13- $ ( '.cms-container' ) . loadPanel ( url ) ;
14- return false ;
15- }
16- } ) ;
17- } ) ;
5+ ( function ( $ ) {
6+ $ . entwine ( "ss" , function ( $ ) {
7+ $ ( ".ReportAdmin .cms-edit-form" ) . entwine ( {
8+ onsubmit : function ( e ) {
9+ let url = $ . path . parseUrl ( document . location . href ) . hrefNoSearch ;
10+ let params = this . find ( ":input[name^=filters]" ) . serializeArray ( ) ;
11+
12+ try {
13+ params = $ . grep ( params , function ( param ) {
14+ // filter out empty
15+ return param . value ;
16+ } ) ;
17+
18+ // convert params to a query string
19+ params = $ . param ( params ) ;
20+
21+ // append query string to url
22+ url += "?" + params ;
23+
24+ $ ( ".cms-container" ) . loadPanel ( url ) ;
25+ } catch ( err ) {
26+ console . error ( err ) ;
27+ }
28+
29+ return false ;
30+ } ,
31+ } ) ;
32+ } ) ;
1833} ) ( jQuery ) ;
You can’t perform that action at this time.
0 commit comments