@@ -36,11 +36,11 @@ define([
3636 filter_warning : '' ,
3737 min_rows : '' ,
3838 max_rows : '' ,
39- max_cols : '' ,
39+ max_columns : '' ,
4040 max_colwidth : '' ,
41+ expand_frame_repr : '' ,
4142 precision : '' ,
4243 chop_threshold : '' ,
43- expand_frame_repr : '' ,
4444 ...this . state
4545 }
4646 }
@@ -51,15 +51,35 @@ define([
5151 var that = this ;
5252
5353 // setting popup - set default
54- $ ( this . wrapSelector ( '#setDefault ' ) ) . on ( 'change' , function ( ) {
54+ $ ( this . wrapSelector ( '#resetDisplay ' ) ) . on ( 'change' , function ( ) {
5555 let checked = $ ( this ) . prop ( 'checked' ) ;
5656
5757 if ( checked ) {
5858 // disable input
59- $ ( that . wrapSelector ( '.vp-po-option input:not([type="checkbox"]) ' ) ) . prop ( 'disabled' , true ) ;
59+ $ ( that . wrapSelector ( '.vp-po-option-item ' ) ) . prop ( 'disabled' , true ) ;
6060 } else {
6161 // enable input
62- $ ( that . wrapSelector ( '.vp-po-option input:not([type="checkbox"])' ) ) . prop ( 'disabled' , false ) ;
62+ $ ( that . wrapSelector ( '.vp-po-option-item' ) ) . prop ( 'disabled' , false ) ;
63+ }
64+ } ) ;
65+
66+ // show all rows
67+ $ ( this . wrapSelector ( '#showAllRows' ) ) . on ( 'change' , function ( ) {
68+ let checked = $ ( this ) . prop ( 'checked' ) ;
69+ if ( checked ) {
70+ $ ( that . wrapSelector ( '#max_rows' ) ) . prop ( 'disabled' , true ) ;
71+ } else {
72+ $ ( that . wrapSelector ( '#max_rows' ) ) . prop ( 'disabled' , false ) ;
73+ }
74+ } ) ;
75+
76+ // show all columns
77+ $ ( this . wrapSelector ( '#showAllColumns' ) ) . on ( 'change' , function ( ) {
78+ let checked = $ ( this ) . prop ( 'checked' ) ;
79+ if ( checked ) {
80+ $ ( that . wrapSelector ( '#max_columns' ) ) . prop ( 'disabled' , true ) ;
81+ } else {
82+ $ ( that . wrapSelector ( '#max_columns' ) ) . prop ( 'disabled' , false ) ;
6383 }
6484 } ) ;
6585
@@ -69,10 +89,10 @@ define([
6989
7090 if ( checked ) {
7191 // disable input
72- $ ( that . wrapSelector ( '.vp-po-warning input:not([type="checkbox"]) ' ) ) . prop ( 'disabled' , true ) ;
92+ $ ( that . wrapSelector ( '.vp-po-warning-item ' ) ) . prop ( 'disabled' , true ) ;
7393 } else {
7494 // enable input
75- $ ( that . wrapSelector ( '.vp-po-warning input:not([type="checkbox"]) ' ) ) . prop ( 'disabled' , false ) ;
95+ $ ( that . wrapSelector ( '.vp-po-warning-item ' ) ) . prop ( 'disabled' , false ) ;
7696 }
7797 } ) ;
7898 }
@@ -93,26 +113,34 @@ define([
93113 let that = this ;
94114 let code = [ ] ;
95115
96- let setDefault = $ ( this . wrapSelector ( '#setDefault ' ) ) . prop ( 'checked' ) ;
116+ let resetDisplay = $ ( this . wrapSelector ( '#resetDisplay ' ) ) . prop ( 'checked' ) ;
97117 let resetWarning = $ ( this . wrapSelector ( '#resetWarning' ) ) . prop ( 'checked' ) ;
98- if ( setDefault == true ) {
99- // Object.keys(this.state).forEach((key) => {
100- // code.push(com_util.formatString("pd.reset_option('display.{0}')", key));
101- // })
102- code . push ( "pd.reset_option('^display')" ) ;
103- } else if ( resetWarning ) {
118+
119+ // warning options
120+ if ( resetWarning === true ) {
104121 code . push ( "import warnings\nwarnings.resetwarnings()" ) ;
105122 } else {
123+ if ( that . state [ 'filter_warning' ] && that . state [ 'filter_warning' ] != '' ) {
124+ code . push ( com_util . formatString ( "import warnings\nwarnings.simplefilter(action='{0}', category=Warning)" , that . state [ 'filter_warning' ] ) ) ;
125+ }
126+ }
127+
128+ // display options
129+ if ( resetDisplay === true ) {
130+ code . push ( "pd.reset_option('^display')" ) ;
131+ } else {
132+ let showAllRows = $ ( this . wrapSelector ( '#showAllRows' ) ) . prop ( 'checked' ) ;
133+ let showAllCols = $ ( this . wrapSelector ( '#showAllColumns' ) ) . prop ( 'checked' ) ;
106134 Object . keys ( this . state ) . forEach ( ( key ) => {
107- if ( that . state [ 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- }
135+ if ( ( showAllRows === true && key === 'max_rows' )
136+ || ( showAllCols === true && key === 'max_columns' ) ) {
137+ code . push ( com_util . formatString ( "pd.set_option('display.{0}', {1})" , key , 'None' ) ) ;
138+ } else if ( key !== 'filter_warning' && that . state [ key ] && that . state [ key ] != '' ) {
139+ code . push ( com_util . formatString ( "pd.set_option('display.{0}', {1})" , key , that . state [ key ] ) ) ;
113140 }
114- } )
141+ } ) ;
115142 }
143+
116144 return code . join ( '\n' ) ;
117145 }
118146
0 commit comments