ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

Introduce `model.document.getRoots()`

Open scofalik opened this issue 2 years ago • 1 comments

📝 Provide a description of the improvement

Introduce model.document.getRoots() that will be a shorthand to model.document.getRootNames().map( name => model.document.getRoot( name ) ).

After introducing multi-root editor, in many places we had to switch to iterating through all roots, instead of taking the default root. Because of that we have a ton of places like:

for ( const rootName of model.document.getRootNames() ) {
	const root = model.document.getRoot( rootName );
	
	// operate on `root`.
}

This doesn't look good.

At the same time, we could make model.document.roots a private property.

scofalik avatar May 24 '23 11:05 scofalik

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

CKEditorBot avatar May 24 '24 03:05 CKEditorBot

We've closed your issue due to inactivity. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).

CKEditorBot avatar Jun 24 '24 03:06 CKEditorBot