#84 JavaScript conversion changes (#85)

This commit is contained in:
Agriya Dev5
2021-03-18 11:24:23 +05:30
committed by GitHub
parent c71284391b
commit 325720f7c8
14 changed files with 146 additions and 91 deletions

View File

@@ -83,31 +83,27 @@ class TopPanel {
}
}
$("#stroke_width").val(gWidth === null ? "" : gWidth);
$id("stroke_width").value = (gWidth === null ? "" : gWidth);
this.editor.bottomPanel.updateColorpickers(true);
break;
}
default: {
this.editor.bottomPanel.updateColorpickers(true);
$("#stroke_width").val(
this.selectedElement.getAttribute("stroke-width") || 1
);
$("#stroke_style").val(
this.selectedElement.getAttribute("stroke-dasharray") || "none"
);
$id("stroke_width").value = this.selectedElement.getAttribute("stroke-width") || 1;
$id("stroke_style").value = this.selectedElement.getAttribute("stroke-dasharray") || "none";
let attr =
this.selectedElement.getAttribute("stroke-linejoin") || "miter";
if ($("#linejoin_" + attr).length) {
this.setStrokeOpt($("#linejoin_" + attr)[0]);
if ($id("linejoin_" + attr).length) {
this.setStrokeOpt($id("linejoin_" + attr));
}
attr = this.selectedElement.getAttribute("stroke-linecap") || "butt";
if ($("#linecap_" + attr).length) {
this.setStrokeOpt($("#linecap_" + attr)[0]);
if ($id("linecap_" + attr).length) {
this.setStrokeOpt($id("linecap_" + attr));
}
}
}
@@ -311,7 +307,7 @@ class TopPanel {
$("#tool_make_link, #tool_make_link_multi").toggle(!linkHref);
if (linkHref) {
$("#link_url").val(linkHref);
$id("link_url").value = linkHref;
}
if (panels[tagName]) {
@@ -329,7 +325,6 @@ class TopPanel {
if (tagName === "text") {
$id("text_panel").style.display = "inline-block";
$id("tool_font_size").style.display = "inline";
$id("tool_italic").pressed = this.editor.svgCanvas.getItalic();
$id("tool_bold").pressed = this.editor.svgCanvas.getBold();
$id("tool_font_family").value = elem.getAttribute("font-family");