|
|
@@ -26,6 +26,13 @@ export default class MediaEmbedUI extends Plugin {
|
|
|
return [ MediaEmbedEditing ];
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @inheritDoc
|
|
|
+ */
|
|
|
+ static get pluginName() {
|
|
|
+ return 'MediaEmbedUI';
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @inheritDoc
|
|
|
*/
|
|
|
@@ -34,13 +41,19 @@ export default class MediaEmbedUI extends Plugin {
|
|
|
const command = editor.commands.get( 'mediaEmbed' );
|
|
|
const registry = editor.plugins.get( MediaEmbedEditing ).registry;
|
|
|
|
|
|
+ /**
|
|
|
+ * The form view displayed inside the drop-down.
|
|
|
+ *
|
|
|
+ * @member {media-embed/ui/mediaformview~MediaFormView}
|
|
|
+ */
|
|
|
+ this.form = new MediaFormView( getFormValidators( editor.t, registry ), editor.locale );
|
|
|
+
|
|
|
// Setup `imageUpload` button.
|
|
|
editor.ui.componentFactory.add( 'mediaEmbed', locale => {
|
|
|
- const form = new MediaFormView( getFormValidators( editor.t, registry ), locale );
|
|
|
const dropdown = createDropdown( locale );
|
|
|
|
|
|
- this._setUpDropdown( dropdown, form, command, editor );
|
|
|
- this._setUpForm( form, dropdown, command );
|
|
|
+ this._setUpDropdown( dropdown, this.form, command, editor );
|
|
|
+ this._setUpForm( this.form, dropdown, command );
|
|
|
|
|
|
return dropdown;
|
|
|
} );
|