collabCompass img and p for content and styling

This commit is contained in:
Shai Mor 2014-09-22 11:36:53 -04:00
parent 0bf28410e6
commit d115861584
2 changed files with 29 additions and 5 deletions

View file

@ -1418,7 +1418,7 @@ Metamaps.Realtime = {
}); });
$('body').click(self.close); $('body').click(self.close);
self.socket = io.connect('http://gentle-savannah-1303.herokuapp.com'); self.socket = io.connect('http://localhost:5001');
self.startActiveMap(); self.startActiveMap();
}, },
toggleBox: function (event) { toggleBox: function (event) {
@ -1598,9 +1598,9 @@ Metamaps.Realtime = {
$('#compass' + data.userid).remove(); $('#compass' + data.userid).remove();
$('<div/>', { $('<div/>', {
id: 'compass' + data.userid, id: 'compass' + data.userid,
text: data.username,
class: 'collabCompass' class: 'collabCompass'
}).appendTo('#wrapper'); }).html('<img width="28" height="28" src="'+data.userimage+'" /><p>'+data.username+'</p>').appendTo('#wrapper');
}, },
newPeerOnMap: function (data) { newPeerOnMap: function (data) {
var self = Metamaps.Realtime; var self = Metamaps.Realtime;
@ -1629,9 +1629,8 @@ Metamaps.Realtime = {
$('#compass' + data.userid).remove(); $('#compass' + data.userid).remove();
$('<div/>', { $('<div/>', {
id: 'compass' + data.userid, id: 'compass' + data.userid,
text: data.username,
class: 'collabCompass' class: 'collabCompass'
}).appendTo('#wrapper'); }).html('<img width="28" height="28" src="'+data.userimage+'" /><p>'+data.username+'</p>').appendTo('#wrapper');
Metamaps.GlobalUI.notifyUser(data.username + ' just joined the map'); Metamaps.GlobalUI.notifyUser(data.username + ' just joined the map');

View file

@ -1924,3 +1924,28 @@ float: left;
.templates { .templates {
display: none; display: none;
} }
/* collabCompass section */
.collabCompass:hover p {
display: block;
}
.collabCompass p {
display: none;
background-color: #4fb5c0;
color: #FFFFFF;
padding: 0 8px 0 8px;
position: absolute;
top: 9px;
left:30px;
z-index: 1;
font-size: 14px;
line-height: 14px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
}
.collabCompass img {
border-radius: 16px;
border: 2px solid #4fb5c0;
z-index: 2;
}