Skip to content

Commit

Permalink
Internal: Enclose placeholder handling within a single if block.
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewand committed Jul 26, 2023
1 parent 32d4d8f commit ce44c03
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/ckeditor5-editor-balloon/src/ballooneditorui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,14 @@ export default class BalloonEditorUI extends EditorUI {
const editor = this.editor;
const editingView = editor.editing.view;
const editingRoot = editingView.document.getRoot()!;

const placeholder = editor.config.get( 'placeholder' );
let placeholderText;

if ( placeholder ) {
placeholderText = typeof placeholder === 'string' ? placeholder : placeholder[ editingRoot.rootName ];
}
const placeholderText = typeof placeholder === 'string' ? placeholder : placeholder[ editingRoot.rootName ];

if ( placeholderText ) {
editingRoot.placeholder = placeholderText;
if ( placeholderText ) {
editingRoot.placeholder = placeholderText;
}
}

enablePlaceholder( {
Expand Down

0 comments on commit ce44c03

Please sign in to comment.