From 1d5f220d128588b6055180bc61ec5ff58aa4619c Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 20 Aug 2013 17:06:07 +0200 Subject: [PATCH] Solved bottom offset problem bzr revid: nicolas.vanhoren@openerp.com-20130820150607-btn650h12nygofcm --- addons/im/static/src/css/im_common.css | 2 +- addons/im/static/src/js/im_common.js | 6 ++++++ addons/im_livechat/static/ext/static/js/livesupport.js | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/im/static/src/css/im_common.css b/addons/im/static/src/css/im_common.css index bfe26b5e838..f3877af1686 100644 --- a/addons/im/static/src/css/im_common.css +++ b/addons/im/static/src/css/im_common.css @@ -36,7 +36,7 @@ .oe_im_chatview { position: fixed; overflow: hidden; - bottom: 42px; + margin-bottom: 5px; margin-right: 6px; background: rgba(60, 60, 60, 0.8); -moz-border-radius: 3px; diff --git a/addons/im/static/src/js/im_common.js b/addons/im/static/src/js/im_common.js index 72097c35f79..d1a67d26d59 100644 --- a/addons/im/static/src/js/im_common.js +++ b/addons/im/static/src/js/im_common.js @@ -72,9 +72,11 @@ function declare($, _, openerp) { anonymous_mode: false }); this.set("right_offset", 0); + this.set("bottom_offset", 0); this.conversations = []; this.users = {}; this.on("change:right_offset", this, this.calc_positions); + this.on("change:bottom_offset", this, this.calc_positions); this.set("window_focus", true); this.set("waiting_messages", 0); this.focus_hdl = _.bind(function() { @@ -259,6 +261,7 @@ function declare($, _, openerp) { calc_positions: function() { var current = this.get("right_offset"); _.each(_.range(this.conversations.length), function(i) { + this.conversations[i].set("bottom_position", this.get("bottom_offset")); this.conversations[i].set("right_position", current); current += this.conversations[i].$().outerWidth(true); }, this); @@ -285,6 +288,7 @@ function declare($, _, openerp) { this.user = user; this.user.add_watcher(); this.set("right_position", 0); + this.set("bottom_position", 0); this.shown = true; this.set("pending", 0); this.inputPlaceholder = this.options.defaultInputPlaceholder; @@ -300,6 +304,7 @@ function declare($, _, openerp) { change_status.call(this); this.on("change:right_position", this, this.calc_pos); + this.on("change:bottom_position", this, this.calc_pos); this.full_height = this.$().height(); this.calc_pos(); this.on("change:pending", this, _.bind(function() { @@ -327,6 +332,7 @@ function declare($, _, openerp) { }, calc_pos: function() { this.$().css("right", this.get("right_position")); + this.$().css("bottom", this.get("bottom_position")); }, received_message: function(message) { if (this.shown) { diff --git a/addons/im_livechat/static/ext/static/js/livesupport.js b/addons/im_livechat/static/ext/static/js/livesupport.js index f61859200e3..fd5cecfe7d9 100644 --- a/addons/im_livechat/static/ext/static/js/livesupport.js +++ b/addons/im_livechat/static/ext/static/js/livesupport.js @@ -80,6 +80,7 @@ define(["openerp", "im_common", "underscore", "require", "jquery", click: function() { if (! this.manager) { this.manager = new im_common.ConversationManager(this, this.options); + this.manager.set("bottom_offset", 37); this.activated_def = this.manager.start_polling(); } var def = $.Deferred();