Add image resizing to history stack (allow undo)
Remove placeholder SVG when main image is loaded
This commit is contained in:
@@ -200,11 +200,13 @@ export default class Image extends SimpleImage {
|
||||
const { tr } = view.state;
|
||||
|
||||
const pos = getPos();
|
||||
const transaction = tr.setNodeMarkup(pos, undefined, {
|
||||
...node.attrs,
|
||||
width,
|
||||
height,
|
||||
});
|
||||
const transaction = tr
|
||||
.setNodeMarkup(pos, undefined, {
|
||||
...node.attrs,
|
||||
width,
|
||||
height,
|
||||
})
|
||||
.setMeta("addToHistory", true);
|
||||
const $pos = transaction.doc.resolve(getPos());
|
||||
view.dispatch(transaction.setSelection(new NodeSelection($pos)));
|
||||
};
|
||||
|
||||
@@ -225,7 +225,9 @@ export default class SimpleImage extends Node {
|
||||
onShowToast,
|
||||
dictionary: this.options.dictionary,
|
||||
replaceExisting: true,
|
||||
width: node.attrs.width,
|
||||
attrs: {
|
||||
width: node.attrs.width,
|
||||
},
|
||||
});
|
||||
};
|
||||
inputElement.click();
|
||||
|
||||
Reference in New Issue
Block a user