|
|
@@ -15,6 +15,7 @@ import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
|
|
|
import Underline from '@ckeditor/ckeditor5-basic-styles/src/underline';
|
|
|
import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
|
|
|
import HorizontalLine from '@ckeditor/ckeditor5-horizontal-line/src/horizontalline';
|
|
|
+import TableEditing from '@ckeditor/ckeditor5-table/src/tableediting';
|
|
|
import global from '@ckeditor/ckeditor5-utils/src/dom/global';
|
|
|
import ResizeObserver from '@ckeditor/ckeditor5-utils/src/dom/resizeobserver';
|
|
|
|
|
|
@@ -56,7 +57,7 @@ describe( 'BalloonToolbar', () => {
|
|
|
|
|
|
return ClassicTestEditor
|
|
|
.create( editorElement, {
|
|
|
- plugins: [ Paragraph, Bold, Italic, BalloonToolbar, HorizontalLine ],
|
|
|
+ plugins: [ Paragraph, Bold, Italic, BalloonToolbar, HorizontalLine, TableEditing ],
|
|
|
balloonToolbar: [ 'bold', 'italic' ]
|
|
|
} )
|
|
|
.then( newEditor => {
|
|
|
@@ -377,13 +378,26 @@ describe( 'BalloonToolbar', () => {
|
|
|
|
|
|
// https://github.com/ckeditor/ckeditor5/issues/6443
|
|
|
it( 'should not add the #toolbarView to the #_balloon when the selection contains more than one fully contained object', () => {
|
|
|
- // This is for multi cell selection in tables.
|
|
|
setData( model, '[<horizontalLine></horizontalLine>]<paragraph>foo</paragraph>[<horizontalLine></horizontalLine>]' );
|
|
|
|
|
|
balloonToolbar.show();
|
|
|
sinon.assert.notCalled( balloonAddSpy );
|
|
|
} );
|
|
|
|
|
|
+ // https://github.com/ckeditor/ckeditor5/issues/6432
|
|
|
+ it( 'should not add the #toolbarView to the #_balloon when the selection contains more than one fully contained selectable', () => {
|
|
|
+ // This is for multi cell selection in tables.
|
|
|
+ setData( model, '<table>' +
|
|
|
+ '<tableRow>' +
|
|
|
+ '[<tableCell><paragraph>foo</paragraph></tableCell>]' +
|
|
|
+ '[<tableCell><paragraph>bar</paragraph></tableCell>]' +
|
|
|
+ '</tableRow>' +
|
|
|
+ '</table>' );
|
|
|
+
|
|
|
+ balloonToolbar.show();
|
|
|
+ sinon.assert.notCalled( balloonAddSpy );
|
|
|
+ } );
|
|
|
+
|
|
|
it( 'should not add #toolbarView to the #_balloon when all components inside #toolbarView are disabled', () => {
|
|
|
Array.from( balloonToolbar.toolbarView.items ).forEach( item => {
|
|
|
item.isEnabled = false;
|