From 3060903c8c886eef78b023c95b37d47f9e04f34e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 29 Jun 2012 14:25:30 +0200 Subject: [PATCH] [IMP] share: share and embed added to 'more' sidebar menu. bzr revid: tde@openerp.com-20120629122530-yyux1swdn4puem1l --- addons/share/static/src/js/share.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/addons/share/static/src/js/share.js b/addons/share/static/src/js/share.js index 380d2f3a8cf..4d7c21a0957 100644 --- a/addons/share/static/src/js/share.js +++ b/addons/share/static/src/js/share.js @@ -50,18 +50,24 @@ openerp.share = function(session) { session.connection.share_flag.done(yes).fail(no); } + /* Extend the Sidebar to add Share and Embed links in the 'More' menu */ session.web.Sidebar = session.web.Sidebar.extend({ - add_default_sections: function() { - this._super(); + + start: function() { var self = this; + this._super(this); has_share(function() { - self.add_items('other', [{ - label: 'Share', - callback: self.on_sidebar_click_share, - classname: 'oe_share', - }]); + self.add_items('other', [ + { label: 'Share', + callback: self.on_sidebar_click_share, + classname: 'oe_chare' }, + { label: 'Embed', + callback: self.on_sidebar_click_share, + classname: 'oe_chare' }, + ]); }); }, + on_sidebar_click_share: function(item) { var view = this.getParent() launch_wizard(this, view);