@@ -33,11 +33,11 @@ define([
3333 this . config . checkModules = [ 'pd' ] ;
3434
3535 this . state = {
36+ filter_warning : '' ,
3637 min_rows : '' ,
3738 max_rows : '' ,
3839 max_cols : '' ,
3940 max_colwidth : '' ,
40- float_format : '' ,
4141 precision : '' ,
4242 chop_threshold : '' ,
4343 expand_frame_repr : '' ,
@@ -56,10 +56,23 @@ define([
5656
5757 if ( checked ) {
5858 // disable input
59- $ ( that . wrapSelector ( '.vp-pandas -option-body input' ) ) . prop ( 'disabled' , true ) ;
59+ $ ( that . wrapSelector ( '.vp-po -option input:not([type="checkbox"]) ' ) ) . prop ( 'disabled' , true ) ;
6060 } else {
6161 // enable input
62- $ ( that . wrapSelector ( '.vp-pandas-option-body input' ) ) . prop ( 'disabled' , false ) ;
62+ $ ( that . wrapSelector ( '.vp-po-option input:not([type="checkbox"])' ) ) . prop ( 'disabled' , false ) ;
63+ }
64+ } ) ;
65+
66+ // setting popup - reset warning
67+ $ ( this . wrapSelector ( '#resetWarning' ) ) . on ( 'change' , function ( ) {
68+ let checked = $ ( this ) . prop ( 'checked' ) ;
69+
70+ if ( checked ) {
71+ // disable input
72+ $ ( that . wrapSelector ( '.vp-po-warning input:not([type="checkbox"])' ) ) . prop ( 'disabled' , true ) ;
73+ } else {
74+ // enable input
75+ $ ( that . wrapSelector ( '.vp-po-warning input:not([type="checkbox"])' ) ) . prop ( 'disabled' , false ) ;
6376 }
6477 } ) ;
6578 }
@@ -81,15 +94,22 @@ define([
8194 let code = [ ] ;
8295
8396 let setDefault = $ ( this . wrapSelector ( '#setDefault' ) ) . prop ( 'checked' ) ;
97+ let resetWarning = $ ( this . wrapSelector ( '#resetWarning' ) ) . prop ( 'checked' ) ;
8498 if ( setDefault == true ) {
8599 // Object.keys(this.state).forEach((key) => {
86100 // code.push(com_util.formatString("pd.reset_option('display.{0}')", key));
87101 // })
88102 code . push ( "pd.reset_option('^display')" ) ;
89- } else {
103+ } else if ( resetWarning ) {
104+ code . push ( "import warnings\nwarnings.resetwarnings()" ) ;
105+ } else {
90106 Object . keys ( this . state ) . forEach ( ( key ) => {
91107 if ( that . state [ key ] && that . state [ key ] != '' ) {
92- code . push ( com_util . formatString ( "pd.set_option('display.{0}', {1})" , key , that . state [ key ] ) ) ;
108+ if ( key === 'filter_warning' ) {
109+ code . push ( com_util . formatString ( "import warnings\nwarnings.simplefilter(action='{0}', category=Warning)" , that . state [ key ] ) ) ;
110+ } else {
111+ code . push ( com_util . formatString ( "pd.set_option('display.{0}', {1})" , key , that . state [ key ] ) ) ;
112+ }
93113 }
94114 } )
95115 }
0 commit comments