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

Commit

Permalink
Refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
f1ames committed Jan 11, 2019
1 parent 64fca69 commit 38e02d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/controller/datacontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,12 @@ export default class DataController {
}

this.model.enqueueChange( 'transparent', writer => {
writer.setSelection( null );

for ( const rootName of Object.keys( newData ) ) {
// Save to model.
const modelRoot = this.model.document.getRoot( rootName );

writer.setSelection( null );
writer.removeSelectionAttribute( this.model.document.selection.getAttributeKeys() );

writer.remove( writer.createRangeIn( modelRoot ) );
Expand Down

0 comments on commit 38e02d1

Please sign in to comment.