mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 09:03:12 +03:00
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:
parent
c8dd95c490
commit
1a673cfe99
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user