[FIX] kanban fixed width + word-wrap

bzr revid: fp@tinyerp.com-20121231141253-dp8w32otnfiudzf7
This commit is contained in:
Fabien Pinckaers 2012-12-31 15:12:53 +01:00
parent 5efdd18b05
commit 08da4d3a7b
3 changed files with 7 additions and 34 deletions

View File

@ -32,7 +32,7 @@
clear: both;
}
.openerp .oe_kanban_view .oe_kanban_content {
word-break: break-all;
word-wrap: break-word;
}
.openerp .oe_kanban_view .oe_kanban_content .oe_star_on, .openerp .oe_kanban_view .oe_kanban_content .oe_star_off {
color: #cccccc;
@ -102,9 +102,6 @@
border-left: 1px solid #f0f8f8;
border-right: 1px solid #b9b9b9;
}
.openerp .oe_kanban_view.oe_kanban_grouped .oe_kanban_group_header {
width: 1%;
}
.openerp .oe_kanban_view .oe_form .oe_kanban_column {
padding: 0px;
background: white;
@ -239,6 +236,7 @@
}
.openerp .oe_kanban_view.oe_kanban_grouped .oe_kanban_record {
margin-bottom: 4px;
width: 200px;
}
.openerp .oe_kanban_view .oe_kanban_avatar_smallbox {
height: 40px;

View File

@ -69,7 +69,7 @@
.oe_kanban_clear
clear: both
.oe_kanban_content
word-break: break-all
word-wrap: break-word
.oe_star_on, .oe_star_off
color: #ccc
text-shadow: 0 0 2px black
@ -126,10 +126,6 @@
background: #f0eeee
border-left: 1px solid #f0f8f8
border-right: 1px solid #b9b9b9
&.oe_kanban_grouped
.oe_kanban_group_header
width: 1%
.oe_form
.oe_kanban_column
padding: 0px
@ -233,8 +229,10 @@
.oe_kanban_title
font-weight: bold
margin: 2px 4px
&.oe_kanban_grouped .oe_kanban_record
margin-bottom: 4px
&.oe_kanban_grouped
.oe_kanban_record
margin-bottom: 4px
width: 200px
.oe_kanban_avatar_smallbox
height: 40px
width: 40px

View File

@ -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;