From 06ca46957cee7d60b68c1f86decb7b727e23c09b Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 3 Dec 2012 15:50:09 +0100 Subject: [PATCH] Added small effect on conversations bzr revid: nicolas.vanhoren@openerp.com-20121203145009-osxforhc5om0zaeu --- addons/web_im/static/src/css/im.css | 1 + addons/web_im/static/src/js/im.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/addons/web_im/static/src/css/im.css b/addons/web_im/static/src/css/im.css index 2da477748cd..5f0ad245187 100644 --- a/addons/web_im/static/src/css/im.css +++ b/addons/web_im/static/src/css/im.css @@ -92,6 +92,7 @@ .openerp .oe_im_chatview { position: fixed; + overflow: hidden; bottom: 6px; margin-right: 6px; background: rgba(0, 0, 0, 0.6); diff --git a/addons/web_im/static/src/js/im.js b/addons/web_im/static/src/js/im.js index 6af20f0f131..4651975bc31 100644 --- a/addons/web_im/static/src/js/im.js +++ b/addons/web_im/static/src/js/im.js @@ -269,6 +269,7 @@ openerp.web_im = function(instance) { events: { "keydown input": "send_message", "click .oe_im_chatview_close": "destroy", + "click .oe_im_chatview_header": "show_hide", }, init: function(parent, user, me) { this._super(parent); @@ -276,11 +277,25 @@ openerp.web_im = function(instance) { this.user = user; this.user.add_watcher(); this.set("right_position", 0); + this.shown = true; }, start: function() { this.on("change:right_position", this, this.calc_pos); + this.full_height = this.$el.height(); this.calc_pos(); }, + show_hide: function() { + if (this.shown) { + this.$el.animate({ + height: this.$(".oe_im_chatview_header").outerHeight(), + }); + } else { + this.$el.animate({ + height: this.full_height, + }); + } + this.shown = ! this.shown; + }, calc_pos: function() { this.$el.css("right", this.get("right_position")); },