Skip to content

Commit

Permalink
[IMP]mail_follower:closed dropdown when there is no child element in ul.
Browse files Browse the repository at this point in the history
bzr revid: dka@tinyerp.com-20140225045142-fg6qbnlvl4ylys0k
  • Loading branch information
dka-odoo committed Feb 25, 2014
1 parent a2cbf7e commit 7dc4130
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion addons/mail/static/src/js/mail_followers.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ openerp_mail_followers = function(session, mail) {
this.$el.on('click', '.oe_subtype_list input', function(event) {
self.do_update_subscription(event);
var $list = self.$('.oe_subtype_list');
if(!$list.hasClass('open'))
if(!$list.hasClass('open')) {
$list.addClass('open');
}
if(self.$('.oe_subtype_list ul')[0].children.length < 1) {
$list.removeClass('open');
}
event.stopPropagation();
});
// event: click on 'invite' button, that opens the invite wizard
Expand Down Expand Up @@ -296,6 +300,7 @@ openerp_mail_followers = function(session, mail) {
},

do_unfollow: function (user_pid) {
var self = this;
if (confirm(_t("Warning! \nYou won't be notified of any email or discussion on this document. Do you really want to unfollow this document ?"))) {
_(this.$('.oe_msg_subtype_check')).each(function (record) {
$(record).attr('checked',false);
Expand Down Expand Up @@ -334,6 +339,8 @@ openerp_mail_followers = function(session, mail) {
if (!checklist.length) {
if (!this.do_unfollow(user_pid)) {
$(event.target).attr("checked", "checked");
} else {
self.$('.oe_subtype_list ul').empty();
}
} else {
var context = new session.web.CompoundContext(this.build_context(), {});
Expand Down

0 comments on commit 7dc4130

Please sign in to comment.