summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorAntony Lesuisse <al@openerp.com>2012-04-02 01:12:12 +0200
committerAntony Lesuisse <al@openerp.com>2012-04-02 01:12:12 +0200
commit7f1eecc8d36a69716892b040c5c31cdffc0987e0 (patch)
tree4e80255d90aa7462387b2192589d264d4303eef0 /addons/web/static/src/js
parenta5aa1bc1a7c7f5aeee290ccb5e5fdec9cd28a00c (diff)
sidebar removal part1
bzr revid: al@openerp.com-20120401231212-dln0svoqcc0pmpxy
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/core.js1
-rw-r--r--addons/web/static/src/js/view_form.js12
-rw-r--r--addons/web/static/src/js/view_list.js8
-rw-r--r--addons/web/static/src/js/views.js31
4 files changed, 14 insertions, 38 deletions
diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js
index da31153ec26..bc2bf951294 100644
--- a/addons/web/static/src/js/core.js
+++ b/addons/web/static/src/js/core.js
@@ -14,7 +14,6 @@ openerp.web.core = function(openerp) {
// a function to override the "extend()" method of JR's inheritance, allowing
// the usage of "include()"
// al: Either move it into novajs or make sure we dont use include, i dont want 2 diff implementations of 'extend'
-
oe_override_class = function(claz){
var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ?
/\b_super\b/ : /.*/;
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index bf79f6adabb..b28f2e92c52 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -108,13 +108,11 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
this.$form_header.find('button.oe_form_button_cancel').click(this.on_button_cancel);
if (!this.sidebar && this.options.sidebar && this.options.sidebar_id) {
- this.sidebar = new openerp.web.Sidebar(this, this.options.sidebar_id);
- this.sidebar.start();
- this.sidebar.do_unfold();
+ this.sidebar = new openerp.web.Sidebar(this);
+ this.sidebar.appendTo(this.$element.find(".oe_form_sidebar"));
this.sidebar.attachments = new openerp.web.form.SidebarAttachments(this.sidebar, this);
this.sidebar.add_toolbar(this.fields_view.toolbar);
this.set_common_sidebar_sections(this.sidebar);
-
this.sidebar.add_section(_t('Customize'), 'customize');
this.sidebar.add_items('customize', [{
label: _t('Set Default'),
@@ -156,17 +154,11 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
result.pipe(function() {
self.$element.css('visibility', 'visible');
});
- if (self.sidebar) {
- self.sidebar.$element.show();
- }
return result;
});
},
do_hide: function () {
this._super();
- if (this.sidebar) {
- this.sidebar.$element.hide();
- }
},
on_record_loaded: function(record) {
var self = this, set_values = [];
diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js
index e8fff450c6e..b93aeb72e25 100644
--- a/addons/web/static/src/js/view_list.js
+++ b/addons/web/static/src/js/view_list.js
@@ -276,10 +276,10 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
.val(self._limit || 'NaN');
});
if (!this.sidebar && this.options.sidebar && this.options.sidebar_id) {
- this.sidebar = new openerp.web.Sidebar(this, this.options.sidebar_id);
- this.sidebar.start();
- this.sidebar.add_toolbar(this.fields_view.toolbar);
- this.set_common_sidebar_sections(this.sidebar);
+ //this.sidebar = new openerp.web.Sidebar(this, this.options.sidebar_id);
+ //this.sidebar.start();
+ //this.sidebar.add_toolbar(this.fields_view.toolbar);
+ //this.set_common_sidebar_sections(this.sidebar);
}
},
/**
diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js
index 54d9b5118e5..f71066990f0 100644
--- a/addons/web/static/src/js/views.js
+++ b/addons/web/static/src/js/views.js
@@ -786,25 +786,21 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner
}
});
-session.web.Sidebar = session.web.OldWidget.extend({
- init: function(parent, element_id) {
- this._super(parent, element_id);
+session.web.Sidebar = session.web.Widget.extend({
+ template: 'Sidebar',
+ init: function(parent) {
+ this._super(parent);
this.items = {};
this.sections = {};
},
start: function() {
this._super(this);
- var self = this;
- this.$element.html(session.web.qweb.render('Sidebar'));
- this.$element.find(".toggle-sidebar").click(function(e) {
- self.do_toggle();
- });
},
add_default_sections: function() {
- var self = this,
- view = this.getParent(),
- view_manager = view.getParent(),
- action = view_manager.action;
+ var self = this;
+ var view = this.getParent();
+ var view_manager = view.getParent();
+ var action = view_manager.action;
if (this.session.uid === 1) {
this.add_section(_t('Customize'), 'customize');
this.add_items('customize', [{
@@ -825,7 +821,6 @@ session.web.Sidebar = session.web.OldWidget.extend({
}
]);
},
-
add_toolbar: function(toolbar) {
var self = this;
_.each([['print', _t("Reports")], ['action', _t("Actions")], ['relate', _t("Links")]], function(type) {
@@ -843,7 +838,6 @@ session.web.Sidebar = session.web.OldWidget.extend({
}
});
},
-
add_section: function(name, code) {
if(!code) code = _.str.underscored(name);
var $section = this.sections[code];
@@ -948,15 +942,6 @@ session.web.Sidebar = session.web.OldWidget.extend({
});
});
},
- do_fold: function() {
- this.$element.addClass('closed-sidebar').removeClass('open-sidebar');
- },
- do_unfold: function() {
- this.$element.addClass('open-sidebar').removeClass('closed-sidebar');
- },
- do_toggle: function() {
- this.$element.toggleClass('open-sidebar closed-sidebar');
- }
});
session.web.TranslateDialog = session.web.Dialog.extend({