1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-21 09:22:09 +03:00

Added image resizing via drag handles

This commit is contained in:
Dan Brown
2022-01-17 17:43:16 +00:00
parent 7622106665
commit 7125530e55
8 changed files with 324 additions and 6 deletions

View File

@ -139,7 +139,9 @@ const image = {
attrs: {
src: {},
alt: {default: null},
title: {default: null}
title: {default: null},
height: {default: null},
width: {default: null},
},
group: "inline",
draggable: true,
@ -148,7 +150,9 @@ const image = {
return {
src: dom.getAttribute("src"),
title: dom.getAttribute("title"),
alt: dom.getAttribute("alt")
alt: dom.getAttribute("alt"),
height: dom.getAttribute("height"),
width: dom.getAttribute("width"),
}
}
}],
@ -157,7 +161,9 @@ const image = {
const src = ref.src;
const alt = ref.alt;
const title = ref.title;
return ["img", {src: src, alt: alt, title: title}]
const width = ref.width;
const height = ref.height;
return ["img", {src, alt, title, width, height}]
}
};