Commit ec8e9a5d authored by Andreas Traczyk's avatar Andreas Traczyk

messageview: use seperate css for the invite image

Change-Id: I62ec84926630a3d395a8d71a24d137b0d972bae8
parent 363e9520
...@@ -419,7 +419,7 @@ a:hover { ...@@ -419,7 +419,7 @@ a:hover {
display: none; display: none;
} }
.sender_image { .sender_image, .invite_sender_image {
border-radius: 50%; border-radius: 50%;
margin: 8px 10px 0px 10px; margin: 8px 10px 0px 10px;
} }
......
...@@ -136,11 +136,11 @@ function showInvitation(contactAlias, contactId) { ...@@ -136,11 +136,11 @@ function showInvitation(contactAlias, contactId) {
invitation.style.visibility = "" invitation.style.visibility = ""
} }
} else { } else {
if (!inviteImage.classList.contains('sender_image')) { if (!inviteImage.classList.contains('invite_sender_image')) {
inviteImage.classList.add('sender_image'); inviteImage.classList.add('invite_sender_image');
} }
if (!inviteImage.classList.contains(`sender_image_${contactId}`)) { if (!inviteImage.classList.contains(`invite_sender_image_${contactId}`)) {
inviteImage.classList.add(`sender_image_${contactId}`); inviteImage.classList.add(`invite_sender_image_${contactId}`);
} }
hasInvitation = true hasInvitation = true
invitationText.innerHTML = "<b>" + contactAlias + " is not in your contacts</b><br/>" invitationText.innerHTML = "<b>" + contactAlias + " is not in your contacts</b><br/>"
...@@ -1507,8 +1507,9 @@ function setSenderImage(set_sender_image_object) ...@@ -1507,8 +1507,9 @@ function setSenderImage(set_sender_image_object)
var sender_contact_method = set_sender_image_object["sender_contact_method"], var sender_contact_method = set_sender_image_object["sender_contact_method"],
sender_image = set_sender_image_object["sender_image"], sender_image = set_sender_image_object["sender_image"],
sender_image_id = "sender_image_" + sender_contact_method, sender_image_id = "sender_image_" + sender_contact_method,
invite_sender_image_id = "invite_sender_image_" + sender_contact_method,
currentSenderImage = document.getElementById(sender_image_id), // Remove the currently set sender image currentSenderImage = document.getElementById(sender_image_id), // Remove the currently set sender image
style style, invite_style
if (currentSenderImage) { if (currentSenderImage) {
currentSenderImage.parentNode.removeChild(currentSenderImage) currentSenderImage.parentNode.removeChild(currentSenderImage)
...@@ -1519,6 +1520,13 @@ function setSenderImage(set_sender_image_object) ...@@ -1519,6 +1520,13 @@ function setSenderImage(set_sender_image_object)
style.type = "text/css" style.type = "text/css"
style.id = sender_image_id style.id = sender_image_id
style.innerHTML = "." + sender_image_id + " {content: url(data:image/png;base64," + sender_image + ");}" style.innerHTML = "." + sender_image_id + " {content: url(data:image/png;base64," + sender_image + ");height: 32px;width: 32px;}"
document.head.appendChild(style) document.head.appendChild(style)
invite_style = document.createElement("style")
invite_style.type = "text/css"
invite_style.id = invite_sender_image_id
invite_style.innerHTML = "." + invite_sender_image_id + " {content: url(data:image/png;base64," + sender_image + ");height: 48px;width: 48px;}"
document.head.appendChild(invite_style)
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment