@@ -36,11 +36,11 @@ define([
36
36
filter_warning : '' ,
37
37
min_rows : '' ,
38
38
max_rows : '' ,
39
- max_cols : '' ,
39
+ max_columns : '' ,
40
40
max_colwidth : '' ,
41
+ expand_frame_repr : '' ,
41
42
precision : '' ,
42
43
chop_threshold : '' ,
43
- expand_frame_repr : '' ,
44
44
...this . state
45
45
}
46
46
}
@@ -51,15 +51,35 @@ define([
51
51
var that = this ;
52
52
53
53
// setting popup - set default
54
- $ ( this . wrapSelector ( '#setDefault ' ) ) . on ( 'change' , function ( ) {
54
+ $ ( this . wrapSelector ( '#resetDisplay ' ) ) . on ( 'change' , function ( ) {
55
55
let checked = $ ( this ) . prop ( 'checked' ) ;
56
56
57
57
if ( checked ) {
58
58
// 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 ) ;
60
60
} else {
61
61
// 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 ) ;
63
83
}
64
84
} ) ;
65
85
@@ -69,10 +89,10 @@ define([
69
89
70
90
if ( checked ) {
71
91
// 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 ) ;
73
93
} else {
74
94
// 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 ) ;
76
96
}
77
97
} ) ;
78
98
}
@@ -93,26 +113,34 @@ define([
93
113
let that = this ;
94
114
let code = [ ] ;
95
115
96
- let setDefault = $ ( this . wrapSelector ( '#setDefault ' ) ) . prop ( 'checked' ) ;
116
+ let resetDisplay = $ ( this . wrapSelector ( '#resetDisplay ' ) ) . prop ( 'checked' ) ;
97
117
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 ) {
104
121
code . push ( "import warnings\nwarnings.resetwarnings()" ) ;
105
122
} 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' ) ;
106
134
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 ] ) ) ;
113
140
}
114
- } )
141
+ } ) ;
115
142
}
143
+
116
144
return code . join ( '\n' ) ;
117
145
}
118
146
0 commit comments