@@ -35,10 +35,12 @@ openerp.web_widget_x2many_2d_matrix_freeze = function (instance) {
35
35
this . stickyHead . width ( this . stickyTable . width ( ) ) ;
36
36
37
37
// Set width of sticky table col
38
- this . stickyCol . find ( "tr:eq(0) th, tr:eq(0) td" ) . each ( function ( i ) {
39
- $ ( this )
40
- . add ( self . stickyInsct . find ( "th,td" ) . eq ( i ) )
41
- . width ( self . stickyTable . find ( "thead th, thead td" ) . eq ( i ) . width ( ) ) ;
38
+ var head_elms = self . stickyTable . find ( "thead th, thead td" ) ;
39
+ this . stickyCol . find ( "tr" ) . each ( function ( j ) {
40
+ $ ( this ) . find ( "th, td" ) . slice ( 0 , self . sticky_x ) . each ( function ( i ) {
41
+ $ ( this )
42
+ . width ( head_elms . eq ( i ) . width ( ) ) ;
43
+ } ) ;
42
44
} ) ;
43
45
} ,
44
46
@@ -167,7 +169,7 @@ openerp.web_widget_x2many_2d_matrix_freeze = function (instance) {
167
169
168
170
if ( this . node . attrs . sticky && _table . length > 0 && _table . parent ( '.sticky-wrap' ) . length == 0 ) {
169
171
170
- var sticky_x = parseInt ( this . node . attrs . sticky_x ) || 1 ;
172
+ this . sticky_x = parseInt ( this . node . attrs . sticky_x ) || 1 ;
171
173
172
174
// Clone <thead>
173
175
var thead = _table . find ( "thead" ) . clone ( ) ,
@@ -198,7 +200,6 @@ openerp.web_widget_x2many_2d_matrix_freeze = function (instance) {
198
200
// Create shorthand for things
199
201
this . sticky = true ;
200
202
this . view_manager = this . $el . parents ( ".oe_view_manager" ) . first ( ) ;
201
- console . log ( this . view_manager ) ;
202
203
this . view_header = this . view_manager . find ( ".oe_view_manager_header" ) ;
203
204
this . view_body = this . view_manager . find ( ".oe_view_manager_body" ) ;
204
205
this . stickyTable = _table ;
@@ -215,7 +216,7 @@ openerp.web_widget_x2many_2d_matrix_freeze = function (instance) {
215
216
. each ( function ( ) {
216
217
$ ( this )
217
218
. find ( "td,th" )
218
- . slice ( sticky_x )
219
+ . slice ( self . sticky_x )
219
220
. css ( "display" , "none" ) ;
220
221
} ) ;
221
222
var margin = $ ( _table . find ( "thead th" ) [ 0 ] ) . css ( "height" ) ;
0 commit comments