[IMP] Support for @class in views definitions
bzr revid: fme@openerp.com-20120627151733-cgtfminjoqoxix11
This commit is contained in:
@@ -250,6 +250,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
|
||||
this.setup_columns(this.fields_view.fields, grouped);
|
||||
|
||||
this.$element.html(QWeb.render(this._template, this));
|
||||
this.$element.addClass(this.fields_view.arch.attrs['class']);
|
||||
// Head hook
|
||||
// Selecting records
|
||||
this.$element.find('.oe_list_record_selector').click(function(){
|
||||
|
||||
@@ -84,6 +84,7 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
|
||||
'fields': this.fields,
|
||||
'toolbar': has_toolbar
|
||||
}));
|
||||
this.$element.addClass(this.fields_view.arch.attrs['class']);
|
||||
|
||||
this.dataset.read_slice(this.fields_list()).then(function(records) {
|
||||
if (!has_toolbar) {
|
||||
|
||||
@@ -50,6 +50,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
|
||||
},
|
||||
on_loaded: function(data) {
|
||||
this.fields_view = data;
|
||||
this.$element.addClass(this.fields_view.arch.attrs['class']);
|
||||
this.calendar_fields = {};
|
||||
this.ids = this.dataset.ids;
|
||||
this.color_values = [];
|
||||
|
||||
@@ -45,6 +45,7 @@ instance.web.DiagramView = instance.web.View.extend({
|
||||
this.connector = this.connectors.attrs.object;
|
||||
|
||||
this.$element.html(QWeb.render("DiagramView", this));
|
||||
this.$element.addClass(this.fields_view.arch.attrs['class']);
|
||||
|
||||
this.$element.find('div.oe_diagram_pager button[data-pager-action]').click(function() {
|
||||
var action = $(this).data('pager-action');
|
||||
|
||||
@@ -19,6 +19,7 @@ instance.web_gantt.GanttView = instance.web.View.extend({
|
||||
on_loaded: function(fields_view_get, fields_get) {
|
||||
var self = this;
|
||||
this.fields_view = fields_view_get;
|
||||
this.$element.addClass(this.fields_view.arch.attrs['class']);
|
||||
return this.rpc("/web/searchview/fields_get", {"model": this.dataset.model}).pipe(function(fields_get) {
|
||||
self.fields = fields_get.fields;
|
||||
self.has_been_loaded.resolve();
|
||||
|
||||
@@ -53,6 +53,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
|
||||
// TODO: move to load_view and document
|
||||
var self = this;
|
||||
this.fields_view = fields_view_get;
|
||||
this.$element.addClass(this.fields_view.arch.attrs['class']);
|
||||
|
||||
this.mode = this.fields_view.arch.attrs.type || 'bar';
|
||||
this.orientation = this.fields_view.arch.attrs.orientation == 'horizontal';
|
||||
|
||||
@@ -48,6 +48,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
|
||||
},
|
||||
on_loaded: function(data) {
|
||||
this.fields_view = data;
|
||||
this.$element.addClass(this.fields_view.arch.attrs['class']);
|
||||
this.$buttons = $(QWeb.render("KanbanView.buttons", {'widget': this}));
|
||||
if (this.options.$buttons) {
|
||||
this.$buttons.appendTo(this.options.$buttons);
|
||||
|
||||
Reference in New Issue
Block a user