diff options
| author | niv-openerp <nicolas.vanhoren@openerp.com> | 2013-09-02 17:14:04 +0200 |
|---|---|---|
| committer | niv-openerp <nicolas.vanhoren@openerp.com> | 2013-09-02 17:14:04 +0200 |
| commit | b4b74f9a208efcffcb0c2e9b8c9c6df7253ded3b (patch) | |
| tree | 583106153190e0400e402f9e0208345e40ca8c3d /addons/im/static/src/js/im.js | |
| parent | 1f9d21552b47b2c326dbeb2a7f1a2b946e8a8297 (diff) | |
Bases of the group chat work
bzr revid: nicolas.vanhoren@openerp.com-20130902151404-gyy9ydjqu5xucpf5
Diffstat (limited to 'addons/im/static/src/js/im.js')
| -rw-r--r-- | addons/im/static/src/js/im.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/addons/im/static/src/js/im.js b/addons/im/static/src/js/im.js index cad3c6dff0b..f26b8f5c4a2 100644 --- a/addons/im/static/src/js/im.js +++ b/addons/im/static/src/js/im.js @@ -70,7 +70,15 @@ var self = this; - return this.c_manager.start_polling(); + return this.c_manager.start_polling().then(function() { + self.c_manager.on("new_conversation", self, function(conv) { + conv.$el.droppable({ + drop: function(event, ui) { + self.add_user(conv, ui.draggable.data("user")); + } + }); + }); + }); }, calc_box: function() { var $topbar = instance.client.$(".oe_topbar"); @@ -133,6 +141,9 @@ self.c_manager.activate_session(session.id, true); }); }, + add_user: function(conversation, user) { + conversation.add_user(user); + }, }); instance.im.UserWidget = instance.web.Widget.extend({ @@ -146,6 +157,8 @@ this.user.add_watcher(); }, start: function() { + this.$el.data("user", this.user); + this.$el.draggable({helper: "clone"}); var change_status = function() { this.$(".oe_im_user_online").toggle(this.user.get("im_status") === true); }; |
