Skip to content

Commit

Permalink
Changing new line separator to '-';
Browse files Browse the repository at this point in the history
  • Loading branch information
pkwasnik committed Nov 23, 2020
1 parent 8d57f6c commit 6aff552
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/builds/guides/migrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ Note: The number of options was reduced on purpose. We understood that configuri
</tr>
<tr>
<td><a href="../../../../ckeditor4/latest/api/CKEDITOR_config.html#cfg-toolbarGroupCycling">toolbarGroupCycling</a> <br> <a href="../../../../ckeditor4/latest/api/CKEDITOR_config.html#cfg-toolbarGroups">toolbarGroups</a></td>
<td>N/A. {@link module:core/editor/editorconfig~EditorConfig#toolbar Toolbar buttons can be grouped} by using <code>'|'</code> as a separator or divided into multiple lines using <code>'/'</code> as a separator.</td>
<td>N/A. {@link module:core/editor/editorconfig~EditorConfig#toolbar Toolbar buttons can be grouped} by using <code>'|'</code> as a separator or divided into multiple lines using <code>'-'</code> as a separator.</td>
</tr>
<tr>
<td><a href="../../../../ckeditor4/latest/api/CKEDITOR_config.html#cfg-toolbarLocation">toolbarLocation</a></td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ DecoupledEditor.defaultConfig = {
'|',
'undo',
'redo',
'/',
'-',
'alignment:left',
'alignment:right',
'alignment:center',
Expand Down
8 changes: 4 additions & 4 deletions packages/ckeditor5-core/src/editor/editorconfig.jsdoc
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@
* Simple format (specifies only toolbar items):
*
* const config = {
* toolbar: [ 'bold', 'italic', '|', 'undo', 'redo', '/', 'numberedList', 'bulletedList' ]
* toolbar: [ 'bold', 'italic', '|', 'undo', 'redo', '-', 'numberedList', 'bulletedList' ]
* };
*
* Extended format:
*
* const config = {
* toolbar: {
* items: [ 'bold', 'italic', '|', 'undo', 'redo', '/', 'numberedList', 'bulletedList' ],
* items: [ 'bold', 'italic', '|', 'undo', 'redo', '-', 'numberedList', 'bulletedList' ],
*
* viewportTopOffset: 30,
*
Expand All @@ -161,9 +161,9 @@
*
* toolbar: [ 'bold', 'italic', '|', 'undo', 'redo' ]
*
* or `'/'` to make a line break, so toolbar will become multiline:
* or `'-'` to make a line break, so toolbar will become multi-line:
*
* toolbar: [ 'bold', 'italic', '/ ', 'undo', 'redo' ]
* toolbar: [ 'bold', 'italic', '-', 'undo', 'redo' ]
*
* * **`toolbar.viewportTopOffset`** &ndash; The offset (in pixels) from the top of the viewport used when positioning a sticky toolbar.
* Useful when a page with which the editor is being integrated has some other sticky or fixed elements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ClassicEditor
'bold',
'italic',
'underline',
'strikethrough',
'|',
'alignment',
'|',
Expand All @@ -34,11 +35,11 @@ ClassicEditor
'link',
'imageUpload',
'insertTable',
'horizontalLine',
'|',
'undo',
'redo'
],
shouldNotGroupWhenFull: true,
viewportTopOffset: window.getViewportTopOffsetConfig()
},
image: {
Expand Down
2 changes: 1 addition & 1 deletion packages/ckeditor5-ui/src/toolbar/toolbarview.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export default class ToolbarView extends View {
this.items.addMany( config.map( name => {
if ( name == '|' ) {
return new ToolbarSeparatorView();
} else if ( name == '/' ) {
} else if ( name == '-' ) {
if ( this.options.shouldGroupWhenFull ) {
/**
* Toolbar line break will work only when button grouping is disabled in the toolbar config:
Expand Down
4 changes: 2 additions & 2 deletions packages/ckeditor5-ui/tests/toolbar/toolbarview.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ describe( 'ToolbarView', () => {
} );

it( 'expands the config into collection', () => {
view.fillFromConfig( [ 'foo', '/', 'bar', '|', 'foo' ], factory );
view.fillFromConfig( [ 'foo', '-', 'bar', '|', 'foo' ], factory );

const items = view.items;

Expand Down Expand Up @@ -443,7 +443,7 @@ describe( 'ToolbarView', () => {
const consoleWarnStub = sinon.stub( console, 'warn' );
view.options.shouldGroupWhenFull = true;

view.fillFromConfig( [ 'foo', '/', 'bar' ], factory );
view.fillFromConfig( [ 'foo', '-', 'bar' ], factory );

sinon.assert.calledOnce( consoleWarnStub );
sinon.assert.calledWithExactly( consoleWarnStub,
Expand Down

0 comments on commit 6aff552

Please sign in to comment.