fix(fa icons): should render everywhere
* setup is not perfect but should do the trick for now * Suggestion: add all the icon the dom and reuse them so that we don't have to do dom.i2svg(); everytime
This commit is contained in:
parent
0ef46fea2f
commit
9f5c5b2f30
@ -3,6 +3,7 @@ import io from 'socket.io-client';
|
|||||||
import whiteboard from "./whiteboard";
|
import whiteboard from "./whiteboard";
|
||||||
import keybinds from "./keybinds";
|
import keybinds from "./keybinds";
|
||||||
import Picker from "vanilla-picker";
|
import Picker from "vanilla-picker";
|
||||||
|
import { dom } from "@fortawesome/fontawesome-svg-core";
|
||||||
|
|
||||||
function main(){
|
function main(){
|
||||||
|
|
||||||
@ -382,6 +383,8 @@ function main(){
|
|||||||
okBtnText: "cancel",
|
okBtnText: "cancel",
|
||||||
headercolor: "#0082c9"
|
headercolor: "#0082c9"
|
||||||
})
|
})
|
||||||
|
// render newly added icons
|
||||||
|
dom.i2svg();
|
||||||
});
|
});
|
||||||
|
|
||||||
// upload json containing steps
|
// upload json containing steps
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import { dom } from "@fortawesome/fontawesome-svg-core";
|
||||||
|
|
||||||
const whiteboard = {
|
const whiteboard = {
|
||||||
canvas: null,
|
canvas: null,
|
||||||
ctx: null,
|
ctx: null,
|
||||||
@ -69,6 +71,10 @@ const whiteboard = {
|
|||||||
.append(_this.cursorContainer)
|
.append(_this.cursorContainer)
|
||||||
.append(_this.textContainer)
|
.append(_this.textContainer)
|
||||||
.append(_this.mouseOverlay);
|
.append(_this.mouseOverlay);
|
||||||
|
|
||||||
|
// render newly added icons
|
||||||
|
dom.i2svg()
|
||||||
|
|
||||||
this.canvas = $("#whiteboardCanvas")[0];
|
this.canvas = $("#whiteboardCanvas")[0];
|
||||||
this.canvas.height = $(window).height();
|
this.canvas.height = $(window).height();
|
||||||
this.canvas.width = $(window).width();
|
this.canvas.width = $(window).width();
|
||||||
@ -596,6 +602,9 @@ const whiteboard = {
|
|||||||
_this.mouseOverlay.append(imgDiv);
|
_this.mouseOverlay.append(imgDiv);
|
||||||
imgDiv.draggable();
|
imgDiv.draggable();
|
||||||
imgDiv.resizable();
|
imgDiv.resizable();
|
||||||
|
|
||||||
|
// render newly added icons
|
||||||
|
dom.i2svg();
|
||||||
},
|
},
|
||||||
drawImgToBackground(url, width, height, left, top) {
|
drawImgToBackground(url, width, height, left, top) {
|
||||||
this.imgContainer.append('<img crossorigin="anonymous" style="width:' + width + 'px; height:' + height + 'px; position:absolute; top:' + top + 'px; left:' + left + 'px;" src="' + url + '">')
|
this.imgContainer.append('<img crossorigin="anonymous" style="width:' + width + 'px; height:' + height + 'px; position:absolute; top:' + top + 'px; left:' + left + 'px;" src="' + url + '">')
|
||||||
@ -654,6 +663,9 @@ const whiteboard = {
|
|||||||
if (this.tool === "text") {
|
if (this.tool === "text") {
|
||||||
textBox.addClass("active");
|
textBox.addClass("active");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// render newly added icons
|
||||||
|
dom.i2svg();
|
||||||
},
|
},
|
||||||
setTextboxText(txId, text) {
|
setTextboxText(txId, text) {
|
||||||
$("#" + txId).find(".textContent").html(decodeURIComponent(escape(atob(text)))); //Set decoded base64 as html
|
$("#" + txId).find(".textContent").html(decodeURIComponent(escape(atob(text)))); //Set decoded base64 as html
|
||||||
|
Loading…
Reference in New Issue
Block a user