mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-27 04:43:12 +03:00
Added blank paragraph insertion when selecting unsplash/gif image
refs https://github.com/TryGhost/Team/issues/1225 - provides a more obvious continuation point after selecting an image - added `scrollIntoView` option to `addParagraphAfterCard()` because for large images the cursor in the new paragraph could be pushed out of the visible area
This commit is contained in:
parent
8e66f6ead5
commit
e419e4e99f
@ -252,10 +252,8 @@ export default Component.extend({
|
||||
// create undo snapshot when selecting an image
|
||||
this.editor.run(() => {
|
||||
saveCard(payload, false);
|
||||
this.addParagraphAfterCard({scrollIntoView: true});
|
||||
});
|
||||
this.deselectCard();
|
||||
this.selectCard();
|
||||
this.scrollToCard();
|
||||
},
|
||||
|
||||
closeImageSelector(reselectParagraph = true) {
|
||||
|
@ -680,7 +680,7 @@ export default Component.extend({
|
||||
}
|
||||
},
|
||||
|
||||
addParagraphAfterCard(card) {
|
||||
addParagraphAfterCard(card, {scrollIntoView = false}) {
|
||||
let editor = this.editor;
|
||||
let section = this.getSectionFromCard(card);
|
||||
let collection = section.parent.sections;
|
||||
@ -700,6 +700,10 @@ export default Component.extend({
|
||||
|
||||
postEditor.setRange(newPara.tailPosition());
|
||||
});
|
||||
|
||||
if (scrollIntoView) {
|
||||
run.schedule('afterRender', this, this._scrollCursorIntoView);
|
||||
}
|
||||
},
|
||||
|
||||
openSelectorComponent(componentName, range) {
|
||||
|
Loading…
Reference in New Issue
Block a user