summaryrefslogtreecommitdiff
path: root/addons/share/static/src/js
diff options
context:
space:
mode:
authorThibault Delavallée <tde@openerp.com>2012-06-29 15:56:57 +0200
committerThibault Delavallée <tde@openerp.com>2012-06-29 15:56:57 +0200
commitce1ed3f928a64652e9a306b4f5c1663e6c8a0a24 (patch)
treea8a10ec38d487084db920c7d24aeb96b1ae0f90d /addons/share/static/src/js
parent8aacfad27e543af9e8863f5670572d222320193a (diff)
[IMP] Share wizard: removed icons and their related code; share is now in the 'more' menu. Cleaned a bit the code.
bzr revid: tde@openerp.com-20120629135657-fwp4q225zzr60dz8
Diffstat (limited to 'addons/share/static/src/js')
-rw-r--r--addons/share/static/src/js/share.js36
1 files changed, 13 insertions, 23 deletions
diff --git a/addons/share/static/src/js/share.js b/addons/share/static/src/js/share.js
index 3e910c0a1dd..33aa3d1aab9 100644
--- a/addons/share/static/src/js/share.js
+++ b/addons/share/static/src/js/share.js
@@ -59,18 +59,23 @@ openerp.share = function(session) {
has_share(function() {
self.add_items('other', [
{ label: 'Share',
- callback: self.on_sidebar_click_share,
+ callback: self.on_click_share,
classname: 'oe_share' },
{ label: 'Embed',
- callback: self.on_sidebar_click_share,
+ callback: self.on_click_share_link,
classname: 'oe_share' },
]);
});
},
- on_sidebar_click_share: function(item) {
+ on_click_share: function(item) {
var view = this.getParent()
- launch_wizard(this, view);
+ launch_wizard(this, view, 'emails', false);
+ },
+
+ on_click_share_link: function(item) {
+ var view = this.getParent()
+ launch_wizard(this, view, 'embedded', false);
},
});
@@ -84,7 +89,7 @@ openerp.share = function(session) {
start: function() {
start_res = this._super.apply(this, arguments);
if (has_action_id) {
- this.$element.find('button.oe_share_mail').show();
+ this.$element.find('button.oe_share_invite').show();
}
return start_res;
}
@@ -95,12 +100,7 @@ openerp.share = function(session) {
var self = this;
this.check_if_action_is_defined();
has_share(function() {
- self.$element.find('a.oe_share_link').click(self.on_click_share_link);
- self.$element.find('a.oe_share').click(self.on_click_share);
- self.$element.delegate('button.oe_share_mail', 'click', self.on_click_share_mail);
- }, function() {
- self.$element.find('a.oe_share_link').remove();
- self.$element.find('a.oe_share').remove();
+ self.$element.delegate('button.oe_share_invite', 'click', self.on_click_share_invite);
});
return this._super.apply(this, arguments);
},
@@ -108,23 +108,13 @@ openerp.share = function(session) {
check_if_action_is_defined: function() {
if (this.action && this.action.id) {
has_action_id = true;
- this.$element.find('a.oe_share_link').show();
- this.$element.find('a.oe_share').show();
}
else {
has_action_id = false;
}
},
-
- on_click_share_link: function(e) {
- e.preventDefault();
- launch_wizard(this, this.views[this.active_view].controller, 'embedded', false);
- },
- on_click_share: function(e) {
- e.preventDefault();
- launch_wizard(this, this.views[this.active_view].controller, 'emails', false);
- },
- on_click_share_mail: function(e) {
+
+ on_click_share_invite: function(e) {
e.preventDefault();
launch_wizard(this, this.views[this.active_view].controller, 'emails', true);
},