Solved bottom offset problem
bzr revid: nicolas.vanhoren@openerp.com-20130820150607-btn650h12nygofcm
This commit is contained in:
parent
d756dc5977
commit
1d5f220d12
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue