fix syntax error and style

This commit is contained in:
raphael 2021-09-13 00:43:52 +02:00
parent 9487653043
commit 10330d4598

View File

@ -810,7 +810,7 @@ const whiteboard = {
'<div class="rotationHandle" style="position:absolute; bottom: -30px; left: 0px; width:100%; text-align:center; cursor:ew-resize;"><i class="fa fa-undo"></i></div>' + '<div class="rotationHandle" style="position:absolute; bottom: -30px; left: 0px; width:100%; text-align:center; cursor:ew-resize;"><i class="fa fa-undo"></i></div>' +
"</div>" "</div>"
); );
imgDiv.prepend(img) imgDiv.prepend(img);
imgDiv imgDiv
.find(".xCanvasBtn") .find(".xCanvasBtn")
.off("click") .off("click")
@ -894,15 +894,17 @@ const whiteboard = {
dom.i2svg(); dom.i2svg();
}, },
drawImgToBackground(url, width, height, left, top, rotationAngle) { drawImgToBackground(url, width, height, left, top, rotationAngle) {
const px = (v) => Number(v).toString() + "px"; const px = (v) => Number(v).toString() + "px";
this.imgContainer.append(this.imageWithSrc(url).css({ this.imgContainer.append(
width: px(width), this.imageWithSrc(url).css({
height: px(height), width: px(width),
top: px(top), height: px(height),
left: px(left), top: px(top),
position: "absolute", left: px(left),
transform: "rotate(" + Number(rotationAngle) + "rad)", position: "absolute",
}); transform: "rotate(" + Number(rotationAngle) + "rad)",
})
);
}, },
addTextBox( addTextBox(
textcolor, textcolor,
@ -1043,9 +1045,8 @@ const whiteboard = {
.css({ "background-color": textboxBackgroundColor }); .css({ "background-color": textboxBackgroundColor });
}, },
drawImgToCanvas(url, width, height, left, top, rotationAngle, doneCallback) { drawImgToCanvas(url, width, height, left, top, rotationAngle, doneCallback) {
top = Number(top); // probably not as important here
top = Number(top); // probably not as important here left = Number(left); // as it is when generating html
left = Number(left); // as it is when generating html
width = Number(width); width = Number(width);
height = Number(height); height = Number(height);
rotationAngle = Number(rotationAngle); rotationAngle = Number(rotationAngle);