Koenig - Allow blank paragraphs to be deleted with Delete

refs https://github.com/TryGhost/Ghost/issues/9311
- adjust our <kbd>Delete</kbd> card deletion logic to not fire if we're on a blank paragraph
- allows blank paragraphs between cards to be deleted, feels more natural
This commit is contained in:
Kevin Ansfield 2018-03-14 11:01:28 +00:00
parent c8dd95c490
commit 1a673cfe99

View File

@ -556,8 +556,11 @@ export default Component.extend({
}
// if the section about to be deleted by a DEL is a card then actually
// delete the card
if (isCollapsed && offset === section.length && section.next && section.next.type === 'card-section') {
// delete the card rather than selecting it
// However, if the current paragraph is blank then delete the paragraph
// instead - allows blank paragraphs between cards to be deleted and
// feels more natural
if (isCollapsed && offset === section.length && section.next && section.next.type === 'card-section' && !section.isBlank) {
let card = this._getCardFromSection(section.next);
this._deleteCard(card, CURSOR_BEFORE);
return;