ballooneditoruiview.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  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 {HTMLElement} [editableElement] The editable element. If not specified, the
  21. * {@link module:ui/editableui/editableuiview~EditableUIView}
  22. * will create it. Otherwise, the existing element will be used.
  23. */
  24. constructor( locale, 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, editableElement );
  33. this.registerChild( this.editable );
  34. }
  35. /**
  36. * @inheritDoc
  37. */
  38. get editableElement() {
  39. return this.editable.element;
  40. }
  41. }