UX: Set selected scale to 100% if scale is undefined
This commit is contained in:
parent
f9fa9b45d0
commit
01e2d5a670
|
@ -15,7 +15,7 @@ function buildToken(state, type, tag, klass, nesting) {
|
||||||
|
|
||||||
function wrapImage(tokens, index, state, imgNumber) {
|
function wrapImage(tokens, index, state, imgNumber) {
|
||||||
const imgToken = tokens[index];
|
const imgToken = tokens[index];
|
||||||
const selectedScale = imgToken.content
|
let selectedScale = imgToken.content
|
||||||
.split(",")
|
.split(",")
|
||||||
.pop()
|
.pop()
|
||||||
.trim();
|
.trim();
|
||||||
|
@ -38,6 +38,9 @@ function wrapImage(tokens, index, state, imgNumber) {
|
||||||
|
|
||||||
const minimumScale = 50;
|
const minimumScale = 50;
|
||||||
const scales = [100, 75, minimumScale];
|
const scales = [100, 75, minimumScale];
|
||||||
|
const overwriteScale = !scales.find(scale => `${scale}%` === selectedScale);
|
||||||
|
if (overwriteScale) selectedScale = "100%";
|
||||||
|
|
||||||
scales.forEach(scale => {
|
scales.forEach(scale => {
|
||||||
const scaleText = `${scale}%`;
|
const scaleText = `${scale}%`;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue