[IMP] share: share and embed added to 'more' sidebar menu.

bzr revid: tde@openerp.com-20120629122530-yyux1swdn4puem1l
This commit is contained in:
Thibault Delavallée 2012-06-29 14:25:30 +02:00
parent b9555aaa8a
commit 3060903c8c
1 changed files with 13 additions and 7 deletions

View File

@ -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);