mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05: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
1 changed files with 5 additions and 2 deletions
|
@ -556,8 +556,11 @@ export default Component.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the section about to be deleted by a DEL is a card then actually
|
// if the section about to be deleted by a DEL is a card then actually
|
||||||
// delete the card
|
// delete the card rather than selecting it
|
||||||
if (isCollapsed && offset === section.length && section.next && section.next.type === 'card-section') {
|
// 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);
|
let card = this._getCardFromSection(section.next);
|
||||||
this._deleteCard(card, CURSOR_BEFORE);
|
this._deleteCard(card, CURSOR_BEFORE);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue