user click to chat

This commit is contained in:
Thibault Duplessis 2014-01-03 20:54:26 +01:00
parent db4c499dc8
commit 890589d176
4 changed files with 6 additions and 11 deletions

View file

@ -28,13 +28,6 @@ case None => {
</a>
}
case Some(true) => {
@if(followsMe(userId)) {
<a class="icon button chat chat_query"
title="@trans.chat()"
data-query="@userId">
<span class="s16 chat"></span>
</a>
}
<a class="button relation hover_text" href="@routes.Relation.unfollow(userId)">
<span class="base s16 tup">@trans.following()</span>
<span class="hover s16 tup">@trans.unfollow()</span>

View file

@ -16,6 +16,7 @@
<span class="lang s16">@name</span>
}
</p>
<a href="@routes.User.show(u.username)">@trans.profile()</a>
@if(followsMe(u.id)) {
@trans.followsYou()
}

View file

@ -1118,6 +1118,10 @@ var storage = {
self.$list = self.element.find("div.content");
self.$nobody = self.element.find("div.nobody");
self.set(self.element.data('preload'));
self.$list.on('click', 'a', function(e) {
$('#chat').onechat('query', $(this).data('id'));
e.preventDefault();
});
},
repaint: function() {
this.users = _.uniq(this.users);
@ -1141,7 +1145,7 @@ var storage = {
this.repaint();
},
_renderUser: function(user) {
return '<a class="ulpt" data-placement="nw" href="/@/' + user + '"><span class="s16">' + user + '</span></a>';
return '<a class="ulpt" data-id="' + user + '" data-placement="nw" href="/@/' + user + '"><span class="s16">' + user + '</span></a>';
}
});

View file

@ -191,9 +191,6 @@ ul.ui-autocomplete li a.ui-state-focus {
position: absolute;
z-index: 2147483647;
}
#powerTip {
width: 270px;
}
#powerTip > .title {
padding: 8px;
border-bottom: 1px solid #c0c0c0;