[FIX] kanban fixed width + word-wrap
bzr revid: fp@tinyerp.com-20121231141253-dp8w32otnfiudzf7
This commit is contained in:
parent
5efdd18b05
commit
08da4d3a7b
|
@ -32,7 +32,7 @@
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
.openerp .oe_kanban_view .oe_kanban_content {
|
.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 {
|
.openerp .oe_kanban_view .oe_kanban_content .oe_star_on, .openerp .oe_kanban_view .oe_kanban_content .oe_star_off {
|
||||||
color: #cccccc;
|
color: #cccccc;
|
||||||
|
@ -102,9 +102,6 @@
|
||||||
border-left: 1px solid #f0f8f8;
|
border-left: 1px solid #f0f8f8;
|
||||||
border-right: 1px solid #b9b9b9;
|
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 {
|
.openerp .oe_kanban_view .oe_form .oe_kanban_column {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
background: white;
|
background: white;
|
||||||
|
@ -239,6 +236,7 @@
|
||||||
}
|
}
|
||||||
.openerp .oe_kanban_view.oe_kanban_grouped .oe_kanban_record {
|
.openerp .oe_kanban_view.oe_kanban_grouped .oe_kanban_record {
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
|
width: 200px;
|
||||||
}
|
}
|
||||||
.openerp .oe_kanban_view .oe_kanban_avatar_smallbox {
|
.openerp .oe_kanban_view .oe_kanban_avatar_smallbox {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
.oe_kanban_clear
|
.oe_kanban_clear
|
||||||
clear: both
|
clear: both
|
||||||
.oe_kanban_content
|
.oe_kanban_content
|
||||||
word-break: break-all
|
word-wrap: break-word
|
||||||
.oe_star_on, .oe_star_off
|
.oe_star_on, .oe_star_off
|
||||||
color: #ccc
|
color: #ccc
|
||||||
text-shadow: 0 0 2px black
|
text-shadow: 0 0 2px black
|
||||||
|
@ -126,10 +126,6 @@
|
||||||
background: #f0eeee
|
background: #f0eeee
|
||||||
border-left: 1px solid #f0f8f8
|
border-left: 1px solid #f0f8f8
|
||||||
border-right: 1px solid #b9b9b9
|
border-right: 1px solid #b9b9b9
|
||||||
&.oe_kanban_grouped
|
|
||||||
.oe_kanban_group_header
|
|
||||||
width: 1%
|
|
||||||
|
|
||||||
.oe_form
|
.oe_form
|
||||||
.oe_kanban_column
|
.oe_kanban_column
|
||||||
padding: 0px
|
padding: 0px
|
||||||
|
@ -233,8 +229,10 @@
|
||||||
.oe_kanban_title
|
.oe_kanban_title
|
||||||
font-weight: bold
|
font-weight: bold
|
||||||
margin: 2px 4px
|
margin: 2px 4px
|
||||||
&.oe_kanban_grouped .oe_kanban_record
|
&.oe_kanban_grouped
|
||||||
margin-bottom: 4px
|
.oe_kanban_record
|
||||||
|
margin-bottom: 4px
|
||||||
|
width: 200px
|
||||||
.oe_kanban_avatar_smallbox
|
.oe_kanban_avatar_smallbox
|
||||||
height: 40px
|
height: 40px
|
||||||
width: 40px
|
width: 40px
|
||||||
|
|
|
@ -322,7 +322,6 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
|
||||||
},
|
},
|
||||||
on_groups_started: function() {
|
on_groups_started: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
this.compute_groups_width();
|
|
||||||
if (this.group_by) {
|
if (this.group_by) {
|
||||||
// Kanban cards drag'n'drop
|
// Kanban cards drag'n'drop
|
||||||
var $columns = this.$el.find('.oe_kanban_column .oe_kanban_column_cards');
|
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() {
|
do_show: function() {
|
||||||
if (this.$buttons) {
|
if (this.$buttons) {
|
||||||
|
@ -695,7 +673,6 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
|
||||||
},
|
},
|
||||||
do_action_toggle_fold: function() {
|
do_action_toggle_fold: function() {
|
||||||
this.do_toggle_fold();
|
this.do_toggle_fold();
|
||||||
this.view.compute_groups_width();
|
|
||||||
},
|
},
|
||||||
do_action_edit: function() {
|
do_action_edit: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
Loading…
Reference in New Issue