fix font size input field

This commit is contained in:
JFH
2021-12-10 17:33:53 +01:00
parent f414d3c0a6
commit 5d315e4e92
4 changed files with 50 additions and 65 deletions

103
package-lock.json generated
View File

@@ -15,7 +15,7 @@
"core-js": "3.19.3", "core-js": "3.19.3",
"elix": "15.0.1", "elix": "15.0.1",
"html2canvas": "1.3.3", "html2canvas": "1.3.3",
"i18next": "21.5.4", "i18next": "21.6.0",
"jspdf": "2.4.0", "jspdf": "2.4.0",
"pathseg": "1.2.1", "pathseg": "1.2.1",
"regenerator-runtime": "0.13.9", "regenerator-runtime": "0.13.9",
@@ -57,9 +57,9 @@
"eslint-plugin-eslint-comments": "3.2.0", "eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-html": "6.2.0", "eslint-plugin-html": "6.2.0",
"eslint-plugin-import": "2.25.3", "eslint-plugin-import": "2.25.3",
"eslint-plugin-jsdoc": "37.1.0", "eslint-plugin-jsdoc": "37.2.0",
"eslint-plugin-markdown": "2.2.1", "eslint-plugin-markdown": "2.2.1",
"eslint-plugin-no-unsanitized": "4.0.0", "eslint-plugin-no-unsanitized": "4.0.1",
"eslint-plugin-no-use-extend-native": "0.5.0", "eslint-plugin-no-use-extend-native": "0.5.0",
"eslint-plugin-node": "11.1.0", "eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "5.2.0", "eslint-plugin-promise": "5.2.0",
@@ -76,7 +76,7 @@
"remark-cli": "10.0.1", "remark-cli": "10.0.1",
"remark-lint-ordered-list-marker-value": "3.1.1", "remark-lint-ordered-list-marker-value": "3.1.1",
"rimraf": "3.0.2", "rimraf": "3.0.2",
"rollup": "2.60.2", "rollup": "2.61.0",
"rollup-plugin-copy": "3.4.0", "rollup-plugin-copy": "3.4.0",
"rollup-plugin-filesize": "9.1.1", "rollup-plugin-filesize": "9.1.1",
"rollup-plugin-html": "^0.2.1", "rollup-plugin-html": "^0.2.1",
@@ -2868,12 +2868,12 @@
"dev": true "dev": true
}, },
"node_modules/@es-joy/jsdoccomment": { "node_modules/@es-joy/jsdoccomment": {
"version": "0.12.0", "version": "0.13.0",
"resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.12.0.tgz", "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.13.0.tgz",
"integrity": "sha512-Gw4/j9v36IKY8ET+W0GoOzrRw17xjf21EIFFRL3zx21fF5MnqmeNpNi+PU/LKjqLpPb2Pw2XdlJbYM31VVo/PQ==", "integrity": "sha512-APVqbVPGOprb4BmjEnwbSzV+V2e/6DVIUnZG3zdW5uWXWkN0DKMCpiIy2TdBauoANKYO7RQpO8cTjIYNVSKwUA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"comment-parser": "1.2.4", "comment-parser": "1.3.0",
"esquery": "^1.4.0", "esquery": "^1.4.0",
"jsdoc-type-pratt-parser": "2.0.0" "jsdoc-type-pratt-parser": "2.0.0"
}, },
@@ -6647,9 +6647,9 @@
} }
}, },
"node_modules/comment-parser": { "node_modules/comment-parser": {
"version": "1.2.4", "version": "1.3.0",
"resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.2.4.tgz", "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.3.0.tgz",
"integrity": "sha512-pm0b+qv+CkWNriSTMsfnjChF9kH0kxz55y44Wo5le9qLxMj5xDQAaEd9ZN1ovSuk9CsrncWaFwgpOMg7ClJwkw==", "integrity": "sha512-hRpmWIKgzd81vn0ydoWoyPoALEOnF4wt8yKD35Ib1D6XC2siLiYaiqfGkYrunuKdsXGwpBpHU3+9r+RVw2NZfA==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">= 12.0.0" "node": ">= 12.0.0"
@@ -8900,12 +8900,12 @@
} }
}, },
"node_modules/eslint-plugin-jsdoc": { "node_modules/eslint-plugin-jsdoc": {
"version": "37.1.0", "version": "37.2.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-37.1.0.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-37.2.0.tgz",
"integrity": "sha512-DpkFzX5Sqkqzy4MCgowhDXmusWcF1Gn7wYnphdGfWmIkoQr6SwL0jEtltGAVyF5Rj6ACi6ydw0oCCI5hF3yz6w==", "integrity": "sha512-ca7s/DD1mMObZQ2Y0n0DO/KnFV+FqCX6ztir8pcSuylg3GGCREIisn36P/0cRySuWW/7Y7MNCuUDqtKdgLPU7Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@es-joy/jsdoccomment": "0.12.0", "@es-joy/jsdoccomment": "0.13.0",
"comment-parser": "1.3.0", "comment-parser": "1.3.0",
"debug": "^4.3.3", "debug": "^4.3.3",
"escape-string-regexp": "^4.0.0", "escape-string-regexp": "^4.0.0",
@@ -8922,15 +8922,6 @@
"eslint": "^7.0.0 || ^8.0.0" "eslint": "^7.0.0 || ^8.0.0"
} }
}, },
"node_modules/eslint-plugin-jsdoc/node_modules/comment-parser": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.3.0.tgz",
"integrity": "sha512-hRpmWIKgzd81vn0ydoWoyPoALEOnF4wt8yKD35Ib1D6XC2siLiYaiqfGkYrunuKdsXGwpBpHU3+9r+RVw2NZfA==",
"dev": true,
"engines": {
"node": ">= 12.0.0"
}
},
"node_modules/eslint-plugin-jsdoc/node_modules/debug": { "node_modules/eslint-plugin-jsdoc/node_modules/debug": {
"version": "4.3.3", "version": "4.3.3",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz",
@@ -8997,9 +8988,9 @@
} }
}, },
"node_modules/eslint-plugin-no-unsanitized": { "node_modules/eslint-plugin-no-unsanitized": {
"version": "4.0.0", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-no-unsanitized/-/eslint-plugin-no-unsanitized-4.0.0.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-no-unsanitized/-/eslint-plugin-no-unsanitized-4.0.1.tgz",
"integrity": "sha512-Wguc3EZS+7BJ/Pgu8C1/G86eXHUIRz4ZHEhPlwVkS42MbHEyfh8Wm+pDRVAg73EE0TR//SbjkPlHr93yLJT10g==", "integrity": "sha512-y/lAMWnPPC7RYuUdxlEL/XiCL8FehN9h9s3Kjqbp/Kv0i9NZs+IXSC2kS546Fa4Bumwy31HlVS/OdWX0Kxb5Xg==",
"dev": true, "dev": true,
"peerDependencies": { "peerDependencies": {
"eslint": "^6 || ^7 || ^8" "eslint": "^6 || ^7 || ^8"
@@ -11095,9 +11086,9 @@
} }
}, },
"node_modules/i18next": { "node_modules/i18next": {
"version": "21.5.4", "version": "21.6.0",
"resolved": "https://registry.npmjs.org/i18next/-/i18next-21.5.4.tgz", "resolved": "https://registry.npmjs.org/i18next/-/i18next-21.6.0.tgz",
"integrity": "sha512-ukwRJpLhYg4EUfCOtbaKjlwF71qyel1XMXQN78OkQMcaQG68UzlYgLC6g2fhoTNBvoH2tJkaaqzDumhC9skAhA==", "integrity": "sha512-RjNuACL35wWZgtkyMcjcCmK7R72u3P6jTNbGKzrvHGI9M0iK5Vn1DsBIwOByppaXLIbe0viJ79Nz2h8w1UwPoQ==",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.12.0" "@babel/runtime": "^7.12.0"
} }
@@ -18791,9 +18782,9 @@
} }
}, },
"node_modules/rollup": { "node_modules/rollup": {
"version": "2.60.2", "version": "2.61.0",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.60.2.tgz", "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.61.0.tgz",
"integrity": "sha512-1Bgjpq61sPjgoZzuiDSGvbI1tD91giZABgjCQBKM5aYLnzjq52GoDuWVwT/cm/MCxCMPU8gqQvkj8doQ5C8Oqw==", "integrity": "sha512-teQ+T1mUYbyvGyUavCodiyA9hD4DxwYZJwr/qehZGhs1Z49vsmzelMVYMxGU4ZhGRKxYPupHuz5yzm/wj7VpWA==",
"bin": { "bin": {
"rollup": "dist/bin/rollup" "rollup": "dist/bin/rollup"
}, },
@@ -25424,12 +25415,12 @@
} }
}, },
"@es-joy/jsdoccomment": { "@es-joy/jsdoccomment": {
"version": "0.12.0", "version": "0.13.0",
"resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.12.0.tgz", "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.13.0.tgz",
"integrity": "sha512-Gw4/j9v36IKY8ET+W0GoOzrRw17xjf21EIFFRL3zx21fF5MnqmeNpNi+PU/LKjqLpPb2Pw2XdlJbYM31VVo/PQ==", "integrity": "sha512-APVqbVPGOprb4BmjEnwbSzV+V2e/6DVIUnZG3zdW5uWXWkN0DKMCpiIy2TdBauoANKYO7RQpO8cTjIYNVSKwUA==",
"dev": true, "dev": true,
"requires": { "requires": {
"comment-parser": "1.2.4", "comment-parser": "1.3.0",
"esquery": "^1.4.0", "esquery": "^1.4.0",
"jsdoc-type-pratt-parser": "2.0.0" "jsdoc-type-pratt-parser": "2.0.0"
} }
@@ -28623,9 +28614,9 @@
"dev": true "dev": true
}, },
"comment-parser": { "comment-parser": {
"version": "1.2.4", "version": "1.3.0",
"resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.2.4.tgz", "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.3.0.tgz",
"integrity": "sha512-pm0b+qv+CkWNriSTMsfnjChF9kH0kxz55y44Wo5le9qLxMj5xDQAaEd9ZN1ovSuk9CsrncWaFwgpOMg7ClJwkw==", "integrity": "sha512-hRpmWIKgzd81vn0ydoWoyPoALEOnF4wt8yKD35Ib1D6XC2siLiYaiqfGkYrunuKdsXGwpBpHU3+9r+RVw2NZfA==",
"dev": true "dev": true
}, },
"common-tags": { "common-tags": {
@@ -30710,12 +30701,12 @@
} }
}, },
"eslint-plugin-jsdoc": { "eslint-plugin-jsdoc": {
"version": "37.1.0", "version": "37.2.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-37.1.0.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-37.2.0.tgz",
"integrity": "sha512-DpkFzX5Sqkqzy4MCgowhDXmusWcF1Gn7wYnphdGfWmIkoQr6SwL0jEtltGAVyF5Rj6ACi6ydw0oCCI5hF3yz6w==", "integrity": "sha512-ca7s/DD1mMObZQ2Y0n0DO/KnFV+FqCX6ztir8pcSuylg3GGCREIisn36P/0cRySuWW/7Y7MNCuUDqtKdgLPU7Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"@es-joy/jsdoccomment": "0.12.0", "@es-joy/jsdoccomment": "0.13.0",
"comment-parser": "1.3.0", "comment-parser": "1.3.0",
"debug": "^4.3.3", "debug": "^4.3.3",
"escape-string-regexp": "^4.0.0", "escape-string-regexp": "^4.0.0",
@@ -30726,12 +30717,6 @@
"spdx-expression-parse": "^3.0.1" "spdx-expression-parse": "^3.0.1"
}, },
"dependencies": { "dependencies": {
"comment-parser": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.3.0.tgz",
"integrity": "sha512-hRpmWIKgzd81vn0ydoWoyPoALEOnF4wt8yKD35Ib1D6XC2siLiYaiqfGkYrunuKdsXGwpBpHU3+9r+RVw2NZfA==",
"dev": true
},
"debug": { "debug": {
"version": "4.3.3", "version": "4.3.3",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz",
@@ -30774,9 +30759,9 @@
} }
}, },
"eslint-plugin-no-unsanitized": { "eslint-plugin-no-unsanitized": {
"version": "4.0.0", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-no-unsanitized/-/eslint-plugin-no-unsanitized-4.0.0.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-no-unsanitized/-/eslint-plugin-no-unsanitized-4.0.1.tgz",
"integrity": "sha512-Wguc3EZS+7BJ/Pgu8C1/G86eXHUIRz4ZHEhPlwVkS42MbHEyfh8Wm+pDRVAg73EE0TR//SbjkPlHr93yLJT10g==", "integrity": "sha512-y/lAMWnPPC7RYuUdxlEL/XiCL8FehN9h9s3Kjqbp/Kv0i9NZs+IXSC2kS546Fa4Bumwy31HlVS/OdWX0Kxb5Xg==",
"dev": true, "dev": true,
"requires": {} "requires": {}
}, },
@@ -32174,9 +32159,9 @@
} }
}, },
"i18next": { "i18next": {
"version": "21.5.4", "version": "21.6.0",
"resolved": "https://registry.npmjs.org/i18next/-/i18next-21.5.4.tgz", "resolved": "https://registry.npmjs.org/i18next/-/i18next-21.6.0.tgz",
"integrity": "sha512-ukwRJpLhYg4EUfCOtbaKjlwF71qyel1XMXQN78OkQMcaQG68UzlYgLC6g2fhoTNBvoH2tJkaaqzDumhC9skAhA==", "integrity": "sha512-RjNuACL35wWZgtkyMcjcCmK7R72u3P6jTNbGKzrvHGI9M0iK5Vn1DsBIwOByppaXLIbe0viJ79Nz2h8w1UwPoQ==",
"requires": { "requires": {
"@babel/runtime": "^7.12.0" "@babel/runtime": "^7.12.0"
} }
@@ -37976,9 +37961,9 @@
} }
}, },
"rollup": { "rollup": {
"version": "2.60.2", "version": "2.61.0",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.60.2.tgz", "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.61.0.tgz",
"integrity": "sha512-1Bgjpq61sPjgoZzuiDSGvbI1tD91giZABgjCQBKM5aYLnzjq52GoDuWVwT/cm/MCxCMPU8gqQvkj8doQ5C8Oqw==", "integrity": "sha512-teQ+T1mUYbyvGyUavCodiyA9hD4DxwYZJwr/qehZGhs1Z49vsmzelMVYMxGU4ZhGRKxYPupHuz5yzm/wj7VpWA==",
"requires": { "requires": {
"fsevents": "~2.3.2" "fsevents": "~2.3.2"
}, },

View File

@@ -74,7 +74,7 @@
"core-js": "3.19.3", "core-js": "3.19.3",
"elix": "15.0.1", "elix": "15.0.1",
"html2canvas": "1.3.3", "html2canvas": "1.3.3",
"i18next": "21.5.4", "i18next": "21.6.0",
"jspdf": "2.4.0", "jspdf": "2.4.0",
"pathseg": "1.2.1", "pathseg": "1.2.1",
"regenerator-runtime": "0.13.9", "regenerator-runtime": "0.13.9",
@@ -116,9 +116,9 @@
"eslint-plugin-eslint-comments": "3.2.0", "eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-html": "6.2.0", "eslint-plugin-html": "6.2.0",
"eslint-plugin-import": "2.25.3", "eslint-plugin-import": "2.25.3",
"eslint-plugin-jsdoc": "37.1.0", "eslint-plugin-jsdoc": "37.2.0",
"eslint-plugin-markdown": "2.2.1", "eslint-plugin-markdown": "2.2.1",
"eslint-plugin-no-unsanitized": "4.0.0", "eslint-plugin-no-unsanitized": "4.0.1",
"eslint-plugin-no-use-extend-native": "0.5.0", "eslint-plugin-no-use-extend-native": "0.5.0",
"eslint-plugin-node": "11.1.0", "eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "5.2.0", "eslint-plugin-promise": "5.2.0",
@@ -135,7 +135,7 @@
"remark-cli": "10.0.1", "remark-cli": "10.0.1",
"remark-lint-ordered-list-marker-value": "3.1.1", "remark-lint-ordered-list-marker-value": "3.1.1",
"rimraf": "3.0.2", "rimraf": "3.0.2",
"rollup": "2.60.2", "rollup": "2.61.0",
"rollup-plugin-copy": "3.4.0", "rollup-plugin-copy": "3.4.0",
"rollup-plugin-filesize": "9.1.1", "rollup-plugin-filesize": "9.1.1",
"rollup-plugin-html": "^0.2.1", "rollup-plugin-html": "^0.2.1",

View File

@@ -133,7 +133,7 @@
<se-button id="tool_italic" title="properties.italic" src="italic.svg" shortcut="I"></se-button> <se-button id="tool_italic" title="properties.italic" src="italic.svg" shortcut="I"></se-button>
<se-select id="tool_font_family" label="properties.font_family_label" <se-select id="tool_font_family" label="properties.font_family_label"
options="properties.serif,properties.sans_serif,properties.cursive,properties.fantasy,properties.monospace,properties.courier,properties.helvetica,properties.times" options="properties.serif,properties.sans_serif,properties.cursive,properties.fantasy,properties.monospace,properties.courier,properties.helvetica,properties.times"
values="Serif::Sans-serif::Cursive::Fantasy::Monospace::Courier::Helvetica::Times"></select> values="Serif::Sans-serif::Cursive::Fantasy::Monospace::Courier::Helvetica::Times"></se-select>
<se-spin-input size="2" id="font_size" min=1 max=1000 step=1 title="properties.font_size" <se-spin-input size="2" id="font_size" min=1 max=1000 step=1 title="properties.font_size"
src="fontsize.svg"></se-spin-input> src="fontsize.svg"></se-spin-input>
</div> </div>

View File

@@ -703,7 +703,7 @@ export const setFontSizeMethod = function (val) {
const selectedElements = elemContext_.getSelectedElements(); const selectedElements = elemContext_.getSelectedElements();
elemContext_.setCurText('font_size', val); elemContext_.setCurText('font_size', val);
elemContext_.getCanvas().changeSelectedAttribute('font-size', val); elemContext_.getCanvas().changeSelectedAttribute('font-size', val);
if (!selectedElements[0].textContent) { if (selectedElements[0] && !selectedElements[0].textContent) {
elemContext_.getCanvas().textActions.setCursor(); elemContext_.getCanvas().textActions.setCursor();
} }
}; };