diff --git a/app/assets/javascripts/room.js b/app/assets/javascripts/room.js index fd346c18..42f91577 100644 --- a/app/assets/javascripts/room.js +++ b/app/assets/javascripts/room.js @@ -122,11 +122,20 @@ $(document).on('turbolinks:load', function(){ listItem.setAttribute('class', 'list-group-item text-left not-saved add-access'); listItem.setAttribute("data-uid", uid) - let spanItem = "" + option.text().charAt(0) + " " + - option.text() + " " + option.data("subtext") + "" + - "" + let spanItemAvatar = document.createElement("span"), + spanItemName = document.createElement("span"), + spanItemUser = document.createElement("span"); + spanItemAvatar.setAttribute('class', 'avatar float-left mr-2'); + spanItemAvatar.innerText = option.text().charAt(0); + spanItemName.setAttribute('class', 'shared-user'); + spanItemName.innerText = option.text(); + spanItemUser.setAttribute('class', 'text-muted'); + spanItemUser.innerText = option.data('subtext'); + spanItemName.append(spanItemUser); - listItem.innerHTML = spanItem + listItem.innerHTML = "" + listItem.prepend(spanItemName); + listItem.prepend(spanItemAvatar); $("#user-list").append(listItem) } @@ -134,7 +143,7 @@ $(document).on('turbolinks:load', function(){ $("#presentation-upload").change(function(data) { var file = data.target.files[0] - + // Check file type and size to make sure they aren't over the limit if (validFileUpload(file)) { $("#presentation-upload-label").text(file.name) @@ -327,4 +336,4 @@ function checkIfAutoJoin() { $("#joiner-consent").click() $("#room-join").click() } -} \ No newline at end of file +}