Skip to content

Commit

Permalink
Shew image again on url change (when hidden before due to previous lo…
Browse files Browse the repository at this point in the history
…ading error)
  • Loading branch information
salmonb committed Dec 12, 2023
1 parent 395d0ea commit c5a7675
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ public void updateImage(Image image) {
setElementAttribute("alt", imageUrl);
// But removing the alt text and hiding the image if the link is broken (to align with JavaFX behaviour which doesn't display such things)
setElementAttribute("onerror", "this.style.display='none'; this.alt=''");
// When we change the image url, we remove the possible display='none' of the previous image (if it was on error)
setElementStyleAttribute("display", null);
// Special case of a canvas image (ex: the WebFX WritableImage emulation code stored the image in a canvas)
HTMLCanvasElement canvasElement = CanvasElementHelper.getCanvasElementAssociatedWithImage(image);
if (canvasElement != null) {
Expand Down

0 comments on commit c5a7675

Please sign in to comment.