[fix] problem with sidebar, removed all references to this.options.sidebar
bzr revid: nicolas.vanhoren@openerp.com-20120418142439-p63hdsfpgmmvayx5
This commit is contained in:
parent
be9f69c8a7
commit
b861606f84
|
@ -24,7 +24,6 @@ instance.web.FormView = instance.web.View.extend({
|
||||||
* @param {instance.web.DataSet} dataset the dataset this view will work with
|
* @param {instance.web.DataSet} dataset the dataset this view will work with
|
||||||
* @param {String} view_id the identifier of the OpenERP view object
|
* @param {String} view_id the identifier of the OpenERP view object
|
||||||
* @param {Object} options
|
* @param {Object} options
|
||||||
* - sidebar : [true|false]
|
|
||||||
* - resize_textareas : [true|false|max_height]
|
* - resize_textareas : [true|false|max_height]
|
||||||
*
|
*
|
||||||
* @property {instance.web.Registry} registry=instance.web.form.widgets widgets registry for this form view instance
|
* @property {instance.web.Registry} registry=instance.web.form.widgets widgets registry for this form view instance
|
||||||
|
@ -109,7 +108,7 @@ instance.web.FormView = instance.web.View.extend({
|
||||||
self.on_pager_action(action);
|
self.on_pager_action(action);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!this.sidebar && this.options.sidebar) {
|
if (!this.sidebar && this.options.$sidebar) {
|
||||||
this.sidebar = new instance.web.Sidebar(this);
|
this.sidebar = new instance.web.Sidebar(this);
|
||||||
this.sidebar.appendTo(this.$sidebar);
|
this.sidebar.appendTo(this.$sidebar);
|
||||||
if(this.fields_view.toolbar) {
|
if(this.fields_view.toolbar) {
|
||||||
|
@ -1215,7 +1214,6 @@ instance.web.form.FormDialog = instance.web.Dialog.extend({
|
||||||
start: function() {
|
start: function() {
|
||||||
this._super();
|
this._super();
|
||||||
this.form = new instance.web.FormView(this, this.dataset, this.view_id, {
|
this.form = new instance.web.FormView(this, this.dataset, this.view_id, {
|
||||||
sidebar: false,
|
|
||||||
pager: false
|
pager: false
|
||||||
});
|
});
|
||||||
this.form.appendTo(this.$element);
|
this.form.appendTo(this.$element);
|
||||||
|
@ -2688,7 +2686,7 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({
|
||||||
var view = {
|
var view = {
|
||||||
view_id: false,
|
view_id: false,
|
||||||
view_type: mode == "tree" ? "list" : mode,
|
view_type: mode == "tree" ? "list" : mode,
|
||||||
options: { sidebar : false }
|
options: {}
|
||||||
};
|
};
|
||||||
if (self.field.views && self.field.views[mode]) {
|
if (self.field.views && self.field.views[mode]) {
|
||||||
view.embedded_view = self.field.views[mode];
|
view.embedded_view = self.field.views[mode];
|
||||||
|
|
|
@ -301,7 +301,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sidebar
|
// Sidebar
|
||||||
if (!this.sidebar && this.options.sidebar && this.options.$sidebar) {
|
if (!this.sidebar && this.options.$sidebar) {
|
||||||
this.sidebar = new instance.web.Sidebar(this);
|
this.sidebar = new instance.web.Sidebar(this);
|
||||||
this.sidebar.appendTo(this.options.$sidebar);
|
this.sidebar.appendTo(this.options.$sidebar);
|
||||||
this.sidebar.add_toolbar(this.fields_view.toolbar);
|
this.sidebar.add_toolbar(this.fields_view.toolbar);
|
||||||
|
@ -464,7 +464,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
|
||||||
view_id: this.view_id,
|
view_id: this.view_id,
|
||||||
view_type: "tree",
|
view_type: "tree",
|
||||||
context: this.dataset.get_context(context),
|
context: this.dataset.get_context(context),
|
||||||
toolbar: this.options.sidebar
|
toolbar: !!this.options.$sidebar
|
||||||
}, callback);
|
}, callback);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -1055,7 +1055,7 @@ instance.web.View = instance.web.Widget.extend({
|
||||||
"model": this.dataset.model,
|
"model": this.dataset.model,
|
||||||
"view_id": this.view_id,
|
"view_id": this.view_id,
|
||||||
"view_type": this.view_type,
|
"view_type": this.view_type,
|
||||||
toolbar: this.options.sidebar,
|
toolbar: !!this.options.$sidebar,
|
||||||
context: context
|
context: context
|
||||||
}).pipe(this.on_loaded);
|
}).pipe(this.on_loaded);
|
||||||
}
|
}
|
||||||
|
@ -1072,7 +1072,6 @@ instance.web.View = instance.web.Widget.extend({
|
||||||
// All possible views options should be defaulted here
|
// All possible views options should be defaulted here
|
||||||
$sidebar: null,
|
$sidebar: null,
|
||||||
sidebar_id: null,
|
sidebar_id: null,
|
||||||
sidebar: true,
|
|
||||||
action: null,
|
action: null,
|
||||||
action_views_ids: {}
|
action_views_ids: {}
|
||||||
});
|
});
|
||||||
|
@ -1163,7 +1162,6 @@ instance.web.View = instance.web.Widget.extend({
|
||||||
*/
|
*/
|
||||||
set_embedded_view: function(embedded_view) {
|
set_embedded_view: function(embedded_view) {
|
||||||
this.embedded_view = embedded_view;
|
this.embedded_view = embedded_view;
|
||||||
this.options.sidebar = false;
|
|
||||||
},
|
},
|
||||||
do_show: function () {
|
do_show: function () {
|
||||||
this.$element.show();
|
this.$element.show();
|
||||||
|
|
|
@ -102,9 +102,9 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
|
||||||
|
|
||||||
this.init_scheduler();
|
this.init_scheduler();
|
||||||
|
|
||||||
if (this.options.sidebar) {
|
if (! this.sidebar && this.options.$sidebar) {
|
||||||
this.sidebar = new instance.web_calendar.Sidebar(this);
|
this.sidebar = new instance.web_calendar.Sidebar(this);
|
||||||
this.has_been_loaded.pipe(this.sidebar.appendTo(this.$element));
|
this.has_been_loaded.pipe(this.sidebar.appendTo(this.options.$sidebar));
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.has_been_loaded.resolve();
|
return this.has_been_loaded.resolve();
|
||||||
|
@ -158,7 +158,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
|
||||||
scheduler.setCurrentView(scheduler._date);
|
scheduler.setCurrentView(scheduler._date);
|
||||||
},
|
},
|
||||||
refresh_minical: function() {
|
refresh_minical: function() {
|
||||||
if (this.options.sidebar) {
|
if (this.sidebar) {
|
||||||
scheduler.updateCalendar(this.sidebar.mini_calendar);
|
scheduler.updateCalendar(this.sidebar.mini_calendar);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -217,7 +217,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({
|
||||||
scheduler.parse(res_events, 'json');
|
scheduler.parse(res_events, 'json');
|
||||||
this.refresh_scheduler();
|
this.refresh_scheduler();
|
||||||
this.refresh_minical();
|
this.refresh_minical();
|
||||||
if (!no_filter_reload && this.options.sidebar) {
|
if (!no_filter_reload && this.sidebar) {
|
||||||
this.sidebar.filter.on_events_loaded(sidebar_items);
|
this.sidebar.filter.on_events_loaded(sidebar_items);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -412,7 +412,6 @@ instance.web_calendar.CalendarFormDialog = instance.web.Dialog.extend({
|
||||||
var self = this;
|
var self = this;
|
||||||
this._super();
|
this._super();
|
||||||
this.form = new instance.web.FormView(this, this.dataset, this.view_id, {
|
this.form = new instance.web.FormView(this, this.dataset, this.view_id, {
|
||||||
sidebar: false,
|
|
||||||
pager: false
|
pager: false
|
||||||
});
|
});
|
||||||
this.form.appendTo(this.$element);
|
this.form.appendTo(this.$element);
|
||||||
|
|
Loading…
Reference in New Issue