[IMP] Misc refactoring

bzr revid: fme@openerp.com-20110905144758-zdrt03ira7ioqzqn
This commit is contained in:
Fabien Meghazi
2011-09-05 16:47:58 +02:00
parent d9d7732099
commit 1a9c5db8bf
2 changed files with 5 additions and 9 deletions
+4 -8
View File
@@ -282,15 +282,14 @@ openerp.base_kanban.KanbanView = openerp.base.View.extend({
if (data.records.length > 0){
_.each(data.records, function(record) {
self.$element.find("#main_" + record.id).children().remove();
self.$element.find("#main_" + record.id).append(self.qweb.render('kanban-box', self.do_process_record(record)));
self.$element.find("#main_" + record.id).append(self.qweb.render('kanban-box', self.do_transform_record(record)));
});
} else {
self.$element.find("#column_" + data.value).remove();
self.all_display_data.splice(index, 1);
}
});
this.$element.find( ".oe_table_column " ).css("width", 99 / self.all_display_data.length +"%");
this.$element.find('button').click(function() {
this.$element.find('button.oe_kanban_button').click(function() {
var record_id = $(this).closest(".oe_kanban_record").attr("id");
if (record_id) {
record_id = parseInt(record_id.split("_")[1])
@@ -305,7 +304,7 @@ openerp.base_kanban.KanbanView = openerp.base.View.extend({
}
});
},
do_process_record: function(record) {
do_transform_record: function(record) {
var self = this,
new_record = {};
_.each(record, function(value, name) {
@@ -375,15 +374,12 @@ openerp.base_kanban.KanbanView = openerp.base.View.extend({
});
});
},
do_show: function () {
this.$element.show();
},
do_hide: function () {
this.$element.hide();
},
}
});
};
@@ -14,7 +14,7 @@
</td>
</tr>
<tr>
<td t-foreach="data" t-as="columns" class="oe_table_column" t-att-id="'column_' + columns.value">
<td t-foreach="data" t-as="columns" class="oe_table_column" t-att-id="'column_' + columns.value" t-attf-style="width: #{Math.round(99 / data.length)}%">
<div class="oe_column" t-att-id="'column_' + columns.value">
<div t-foreach="columns.records" t-as="record" class="oe_kanban_record" t-att-id="'main_' + record.id"/>
</div>