Added small effect on conversations

bzr revid: nicolas.vanhoren@openerp.com-20121203145009-osxforhc5om0zaeu
This commit is contained in:
niv-openerp
2012-12-03 15:50:09 +01:00
parent 6b0cd14ce8
commit 06ca46957c
2 changed files with 16 additions and 0 deletions
+1
View File
@@ -92,6 +92,7 @@
.openerp .oe_im_chatview {
position: fixed;
overflow: hidden;
bottom: 6px;
margin-right: 6px;
background: rgba(0, 0, 0, 0.6);
+15
View File
@@ -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"));
},