Merge pull request #1470 from kendallcorner/master

Default favicon now displays for Edit Containers panel (issue #1314)
This commit is contained in:
luke crouch 2019-08-07 10:41:30 -05:00 committed by GitHub
commit 9372899bfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -985,9 +985,9 @@ Logic.registerPanel(P_CONTAINER_EDIT, {
const trElement = document.createElement("div");
/* As we don't have the full or correct path the best we can assume is the path is HTTPS and then replace with a broken icon later if it doesn't load.
This is pending a better solution for favicons from web extensions */
const assumedUrl = `https://${site.hostname}`;
const assumedUrl = `https://${site.hostname}/favicon.ico`;
trElement.innerHTML = escaped`
<img class="icon" src="${assumedUrl}/favicon.ico">
<div class="favicon"></div>
<div title="${site.hostname}" class="truncate-text hostname">
${site.hostname}
</div>
@ -995,6 +995,7 @@ Logic.registerPanel(P_CONTAINER_EDIT, {
class="pop-button-image delete-assignment"
src="/img/container-delete.svg"
/>`;
trElement.getElementsByClassName("favicon")[0].appendChild(Utils.createFavIconElement(assumedUrl));
const deleteButton = trElement.querySelector(".delete-assignment");
const that = this;
Logic.addEnterHandler(deleteButton, async () => {