File tree Expand file tree Collapse file tree 1 file changed +19
-9
lines changed
assets/ckeditor/plugins/PartDBLabel Expand file tree Collapse file tree 1 file changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ require('./lang/de.js');
2424import { addListToDropdown , createDropdown } from 'ckeditor5' ;
2525
2626import { Collection } from 'ckeditor5' ;
27- import { Model } from 'ckeditor5' ;
27+ import { UIModel } from 'ckeditor5' ;
2828
2929export default class PartDBLabelUI extends Plugin {
3030 init ( ) {
@@ -151,18 +151,28 @@ const PLACEHOLDERS = [
151151function getDropdownItemsDefinitions ( t ) {
152152 const itemDefinitions = new Collection ( ) ;
153153
154+ let first = true ;
155+
154156 for ( const group of PLACEHOLDERS ) {
157+
155158 //Add group header
156- itemDefinitions . add ( {
157- 'type' : 'separator' ,
158- model : new Model ( {
159- withText : true ,
160- } )
161- } ) ;
159+
160+ //Skip separator for first group
161+ if ( ! first ) {
162+
163+ itemDefinitions . add ( {
164+ 'type' : 'separator' ,
165+ model : new UIModel ( {
166+ withText : true ,
167+ } )
168+ } ) ;
169+ } else {
170+ first = false ;
171+ }
162172
163173 itemDefinitions . add ( {
164174 type : 'button' ,
165- model : new Model ( {
175+ model : new UIModel ( {
166176 label : t ( group . label ) ,
167177 withText : true ,
168178 isEnabled : false ,
@@ -173,7 +183,7 @@ function getDropdownItemsDefinitions(t) {
173183 for ( const entry of group . entries ) {
174184 const definition = {
175185 type : 'button' ,
176- model : new Model ( {
186+ model : new UIModel ( {
177187 commandParam : entry [ 0 ] ,
178188 label : t ( entry [ 1 ] ) ,
179189 tooltip : entry [ 0 ] ,
You can’t perform that action at this time.
0 commit comments