Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Moved early return in deleteContent... earlier.
Browse files Browse the repository at this point in the history
  • Loading branch information
scofalik committed Mar 28, 2019
1 parent 43cf297 commit a264d2c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/model/utils/deletecontent.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ export default function deleteContent( model, selection, options = {} ) {
return;
}

const schema = model.schema;
const selRange = selection.getFirstRange();

model.change( writer => {
const selRange = selection.getFirstRange();
// If the selection is already removed, don't do anything.
if ( selRange.root.rootName == '$graveyard' ) {
return;
}

// If the selection is already removed, don't do anything.
if ( selRange.root.rootName == '$graveyard' ) {
return;
}
const schema = model.schema;

model.change( writer => {
// 1. Replace the entire content with paragraph.
// See: https://github.com/ckeditor/ckeditor5-engine/issues/1012#issuecomment-315017594.
if ( !options.doNotResetEntireContent && shouldEntireContentBeReplacedWithParagraph( schema, selection ) ) {
Expand Down

0 comments on commit a264d2c

Please sign in to comment.