Skip to content

Commit

Permalink
fixup! [FIX] sticky column bug, sometimes eclipsing editable fields
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaspaulb committed Mar 11, 2021
1 parent 539bf68 commit 1bd17cc
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ openerp.web_widget_x2many_2d_matrix_freeze = function (instance) {
this.stickyHead.width(this.stickyTable.width());

// Set width of sticky table col
this.stickyCol.find("tr:eq(0) th, tr:eq(0) td").each(function (i) {
$(this)
.add(self.stickyInsct.find("th,td").eq(i))
.width(self.stickyTable.find("thead th, thead td").eq(i).width());
var head_elms = self.stickyTable.find("thead th, thead td");
this.stickyCol.find("tr").each(function(j) {
$(this).find("th, td").slice(0, self.sticky_x).each(function (i) {
$(this)
.width(head_elms.eq(i).width());
});
});
},

Expand Down Expand Up @@ -167,7 +169,7 @@ openerp.web_widget_x2many_2d_matrix_freeze = function (instance) {

if (this.node.attrs.sticky && _table.length > 0 && _table.parent('.sticky-wrap').length == 0) {

var sticky_x = parseInt(this.node.attrs.sticky_x) || 1;
this.sticky_x = parseInt(this.node.attrs.sticky_x) || 1;

// Clone <thead>
var thead = _table.find("thead").clone(),
Expand Down Expand Up @@ -198,7 +200,6 @@ openerp.web_widget_x2many_2d_matrix_freeze = function (instance) {
// Create shorthand for things
this.sticky = true;
this.view_manager = this.$el.parents(".oe_view_manager").first();
console.log(this.view_manager);
this.view_header = this.view_manager.find(".oe_view_manager_header");
this.view_body = this.view_manager.find(".oe_view_manager_body");
this.stickyTable = _table;
Expand All @@ -215,7 +216,7 @@ openerp.web_widget_x2many_2d_matrix_freeze = function (instance) {
.each(function() {
$(this)
.find("td,th")
.slice(sticky_x)
.slice(self.sticky_x)
.css("display", "none");
});
var margin = $(_table.find("thead th")[0]).css("height");
Expand Down

0 comments on commit 1bd17cc

Please sign in to comment.