Feature: Introduced BlockToolbar plugin. #392
Conversation
Does |
Button should be displayed next to all headers. Button is not displayed next to image because there are no available options in toolbar for changing image. |
No it's not. |
const toPx = toUnit( 'px' ); | ||
|
||
/** | ||
* The block button view class. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing docs. What is this button? What's its purpose? What's its behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
src/toolbar/block/blocktoolbar.js
Outdated
* | ||
* @type {module:ui/toolbar/toolbarview~ToolbarView} | ||
*/ | ||
this.toolbarView = new ToolbarView( editor.locale ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likely missing
this.toolbar.extendTemplate( {
attributes: {
class: [
// https://github.com/ckeditor/ckeditor5-editor-inline/issues/11
'ck-toolbar_floating'
]
}
} );
just like in the InlineEditorUIView
and BalloonToolbar
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
The button fails to reposition as the target is being scrolled inside an Should we handle this case? If so, even if we used the |
*/ | ||
|
||
/** | ||
* @module ui/toolbar/block/view/blockbuttonview |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this view
subfolder? It's unlikely another view will be there and it makes the structure unnecessarily complex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll move this view to ui/toolbar/block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
tests/toolbar/block/blocktoolbar.js
Outdated
@@ -70,11 +70,11 @@ describe( 'BlockToolbar', () => { | |||
} ); | |||
|
|||
it( 'should add panelView to ui.focusTracker', () => { | |||
expect( editor.ui.focusTracker.isFocused ).to.false; | |||
expect( editor.ui.focusTracker.isFocused ).to.be.false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:(
I think we should handle this case and have one common problem with floating stuff + scroll. |
Ticket about repositioning on scroll issue https://github.com/ckeditor/ckeditor5-ui/issues/398. |
Suggested merge commit message (convention)
Feature: Introduced BlockToolbar plugin. Closes ckeditor/ckeditor5#5454.
Requires:
beforeChange
event toObservableMixin
. ckeditor5-utils#241beforeChange
instead ofchange
to force command read-only mode. ckeditor5-core#128Constelation - https://github.com/ckeditor/ckeditor5/tree/t/ckeditor5-ui/391
Preview