[REM] Removed crappy kanban header width computing
lp bug: https://launchpad.net/bugs/1091643 fixed bzr revid: fme@openerp.com-20121220153526-i8os7vzkaga7mnzq
This commit is contained in:
parent
c2b5c3305b
commit
f8ed6f41c1
|
@ -103,6 +103,9 @@
|
|||
border-right: 1px solid #b9b9b9;
|
||||
}
|
||||
.openerp .oe_kanban_view.oe_kanban_grouped .oe_kanban_group_header {
|
||||
width: 170px;
|
||||
}
|
||||
.openerp .oe_kanban_view.oe_kanban_grouped .oe_kanban_group_header.oe_kanban_group_folded {
|
||||
width: 1%;
|
||||
}
|
||||
.openerp .oe_kanban_view .oe_form .oe_kanban_column {
|
||||
|
|
|
@ -128,6 +128,8 @@
|
|||
border-right: 1px solid #b9b9b9
|
||||
&.oe_kanban_grouped
|
||||
.oe_kanban_group_header
|
||||
width: 170px
|
||||
.oe_kanban_group_header.oe_kanban_group_folded
|
||||
width: 1%
|
||||
|
||||
.oe_form
|
||||
|
|
|
@ -322,7 +322,6 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
|
|||
},
|
||||
on_groups_started: function() {
|
||||
var self = this;
|
||||
this.compute_groups_width();
|
||||
if (this.group_by) {
|
||||
// Kanban cards drag'n'drop
|
||||
var $columns = this.$el.find('.oe_kanban_column .oe_kanban_column_cards');
|
||||
|
@ -420,27 +419,6 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
|
|||
});
|
||||
}
|
||||
},
|
||||
compute_groups_width: function() {
|
||||
var unfolded = 0;
|
||||
var self = this;
|
||||
_.each(this.groups, function(group) {
|
||||
unfolded += group.state.folded ? 0 : 1;
|
||||
group.$el.children(':first').css('width', '');
|
||||
});
|
||||
_.each(this.groups, function(group) {
|
||||
if (!group.state.folded) {
|
||||
if (182*unfolded>=self.$el.width()) {
|
||||
group.$el.children(':first').css('width', "170px");
|
||||
} else if (262*unfolded<self.$el.width()) {
|
||||
group.$el.children(':first').css('width', "250px");
|
||||
} else {
|
||||
// -12 because of padding 6 between cards
|
||||
// -1 because of the border of the latest dummy column
|
||||
group.$el.children(':first').css('width', Math.floor((self.$el.width()-1)/unfolded)-12 + 'px');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
do_show: function() {
|
||||
if (this.$buttons) {
|
||||
|
@ -695,7 +673,6 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
|
|||
},
|
||||
do_action_toggle_fold: function() {
|
||||
this.do_toggle_fold();
|
||||
this.view.compute_groups_width();
|
||||
},
|
||||
do_action_edit: function() {
|
||||
var self = this;
|
||||
|
|
Loading…
Reference in New Issue