mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 19:56:18 +08:00
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) {
|
||||
const imgToken = tokens[index];
|
||||
const selectedScale = imgToken.content
|
||||
let selectedScale = imgToken.content
|
||||
.split(",")
|
||||
.pop()
|
||||
.trim();
|
||||
|
@ -38,6 +38,9 @@ function wrapImage(tokens, index, state, imgNumber) {
|
|||
|
||||
const minimumScale = 50;
|
||||
const scales = [100, 75, minimumScale];
|
||||
const overwriteScale = !scales.find(scale => `${scale}%` === selectedScale);
|
||||
if (overwriteScale) selectedScale = "100%";
|
||||
|
||||
scales.forEach(scale => {
|
||||
const scaleText = `${scale}%`;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user