Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

t/1: The first implementation of the balloon toolbar editor #2

Merged
merged 3 commits into from
May 31, 2017

Conversation

oleq
Copy link
Member

@oleq oleq commented May 26, 2017

Copy link
Contributor

@szymonkups szymonkups left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor things to fix, beside that it looks great.

*/

/**
* @module editor-balloon-toolbar/contextual
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be editor-balloon-toolbar/balloontoolbareditor ?

}

/**
* Creates an balloon toolbar editor instance.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"a balloon toolbar"?


/**
* The balloon toolbar editor. Uses an inline editable and a toolbar based
* on the {@link ui/toolbar/contextual/contextualtoolbar~ContextualToolbar}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module:ui/toolbar/contextual/contextualtoolbar~ContextualToolbar

super( element, config );

this.config.get( 'plugins' ).push( ContextualToolbar );
this.config.define( 'contextualToolbar', this.config.get( 'toolbar' ) );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if this will not cause any issues, because it will (correct me if I am wrong) copy reference to same object, so further changes to toolbar configuration will also affect contextualToolbar. Or maybe this is desired behavior?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well... this is quite a story. At the very beginning, this editor type expected developers to configure it like this:

BalloonToolbarEditor.create( editorElement, {
	plugins: [ ContextualToolbar ],
	contextualToolbar: [ ... ]
} );

but in a F2F talk with @Reinmar we found out this is not a very straightforward since editor-inline and editor-classic don't require a) any special plugins b) custom config names (toolbar vs contextualToolbar).

So we decided to hack things a little bit to load ContextualToolbar automatically and create a "bridge" between cfg.toolbar and cfg.contextualToolbar to keep the API between the creators as similar as possible.

so further changes to toolbar configuration will also affect contextualToolbar

Well, I suppose it doesn't matter. Once you decide to use BalloonToolbarEditor, it takes the full control over ContextualToolbar. I don't see how ContextualToolbar could remain useful for other features once seized by the BalloonToolbarEditor 🤔 .


@import '~@ckeditor/ckeditor5-theme-lark/theme/theme.scss';

// TODO move to make a common style with editor-classic.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it for the future reference?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created an issue for this. We'll fix it as a follow-up.

@szymonkups szymonkups merged commit a4462ac into master May 31, 2017
@szymonkups szymonkups deleted the t/1 branch May 31, 2017 09:42
bhayward93 pushed a commit to bhayward93/ckeditor5-editor-balloon that referenced this pull request Feb 27, 2020
Other: Optimized the bundle size (~10%) by enabling webpack's `ModuleConcatenationPlugin` plugin. Read more ckeditor/ckeditor5#475.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants