From 26ecd1182e6cec6458801b43b75450be144eef57 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Thu, 6 Sep 2018 14:07:15 +0100 Subject: [PATCH] Completed cloudinaryv2 fix --- app/assets/stylesheets/pages/_contacts.scss | 1 + app/javascript/packs/application.js | 4 +++- app/views/pages/_contact.html.erb | 4 ++-- app/views/shared/_navbar.html.erb | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/pages/_contacts.scss b/app/assets/stylesheets/pages/_contacts.scss index e2cdc7c..7e420f5 100644 --- a/app/assets/stylesheets/pages/_contacts.scss +++ b/app/assets/stylesheets/pages/_contacts.scss @@ -152,6 +152,7 @@ a:hover { @media only screen and (max-width: 1100px) { .modal-picture { width: 50px; + height: 50px; } } diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index 948618c..5e9289f 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -81,8 +81,10 @@ App.cable.subscriptions.create({ acceptButton.style.display = "block" triggerCalleeModalEvent() + const photo = document.getElementById('caller-photo'); document.getElementById('caller-name').innerHTML = data["message"]["caller_info"] - document.getElementById('caller-photo').src = data["message"]["caller_photo"] + photo.src = data["message"]["caller_photo"]; + photo.style.objectFit = "cover"; chatRoomId = data["message"]["chat_room_id"] console.log(`user with id: ${userId} needs to subscribe to chatroom ${[chatRoomId]}`) diff --git a/app/views/pages/_contact.html.erb b/app/views/pages/_contact.html.erb index 86f0f0d..e3c3aca 100644 --- a/app/views/pages/_contact.html.erb +++ b/app/views/pages/_contact.html.erb @@ -4,7 +4,7 @@ <% else %> <%= cl_image_tag(contact.photo, class: "profile avatar dropdown-toggle img-circle", width:65, transformation: [ - { gravity: "face:auto", width: 100, height: 100, radius: "max", crop: "crop" } + { gravity: "face:auto", width: 500, height: 500, radius: "max", crop: "crop" } ])%> <% end %>
@@ -42,7 +42,7 @@ <% else %> <%= cl_image_tag(contact.photo, class: "profile avatar dropdown-toggle img-circle modal-picture", width:150, transformation: [ - { gravity: "face:auto", width: 100, height: 100, radius: "max", crop: "crop" }])%> + { gravity: "face:auto", width: 500, height: 500, radius: "max", crop: "crop" }])%> <% end %>