diff --git a/src/js/main.js b/src/js/main.js index 8d676fc..02e34ec 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -3,6 +3,7 @@ import io from 'socket.io-client'; import whiteboard from "./whiteboard"; import keybinds from "./keybinds"; import Picker from "vanilla-picker"; +import { dom } from "@fortawesome/fontawesome-svg-core"; function main(){ @@ -382,6 +383,8 @@ function main(){ okBtnText: "cancel", headercolor: "#0082c9" }) + // render newly added icons + dom.i2svg(); }); // upload json containing steps diff --git a/src/js/whiteboard.js b/src/js/whiteboard.js index 9f608bb..4e7a3ee 100644 --- a/src/js/whiteboard.js +++ b/src/js/whiteboard.js @@ -1,3 +1,5 @@ +import { dom } from "@fortawesome/fontawesome-svg-core"; + const whiteboard = { canvas: null, ctx: null, @@ -69,6 +71,10 @@ const whiteboard = { .append(_this.cursorContainer) .append(_this.textContainer) .append(_this.mouseOverlay); + + // render newly added icons + dom.i2svg() + this.canvas = $("#whiteboardCanvas")[0]; this.canvas.height = $(window).height(); this.canvas.width = $(window).width(); @@ -596,6 +602,9 @@ const whiteboard = { _this.mouseOverlay.append(imgDiv); imgDiv.draggable(); imgDiv.resizable(); + + // render newly added icons + dom.i2svg(); }, drawImgToBackground(url, width, height, left, top) { this.imgContainer.append('') @@ -654,6 +663,9 @@ const whiteboard = { if (this.tool === "text") { textBox.addClass("active"); } + + // render newly added icons + dom.i2svg(); }, setTextboxText(txId, text) { $("#" + txId).find(".textContent").html(decodeURIComponent(escape(atob(text)))); //Set decoded base64 as html