ballooneditoruiview.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. /**
  6. * @module editor-balloon/ballooneditoruiview
  7. */
  8. import EditorUIView from '@ckeditor/ckeditor5-ui/src/editorui/editoruiview';
  9. import InlineEditableUIView from '@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview';
  10. /**
  11. * Contextual editor UI view. Uses the {@link module:ui/editableui/inline/inlineeditableuiview~InlineEditableUIView}.
  12. *
  13. * @extends module:ui/editorui/editoruiview~EditorUIView
  14. */
  15. export default class BalloonEditorUIView extends EditorUIView {
  16. /**
  17. * Creates an instance of the balloon editor UI view.
  18. *
  19. * @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor#locale} instance.
  20. * @param {module:engine/view/view~View} editingView The editing view instance this view is related to.
  21. * @param {HTMLElement} [editableElement] The editable element. If not specified, it will be automatically created by
  22. * {@link module:ui/editableui/editableuiview~EditableUIView}. Otherwise, the given element will be used.
  23. */
  24. constructor( locale, editingView, editableElement ) {
  25. super( locale );
  26. /**
  27. * The editable UI view.
  28. *
  29. * @readonly
  30. * @member {module:ui/editableui/inline/inlineeditableuiview~InlineEditableUIView}
  31. */
  32. this.editable = new InlineEditableUIView( locale, editingView, editableElement );
  33. }
  34. /**
  35. * @inheritDoc
  36. */
  37. render() {
  38. super.render();
  39. this.registerChild( this.editable );
  40. }
  41. }