classiceditoruiview.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /**
  6. * @module editor-classic/classiceditoruiview
  7. */
  8. import BoxedEditorUIView from '@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview';
  9. import InlineEditableUIView from '@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview';
  10. import StickyToolbarView from '@ckeditor/ckeditor5-ui/src/toolbar/sticky/stickytoolbarview';
  11. /**
  12. * Classic editor UI view. Uses inline editable and sticky toolbar, all
  13. * enclosed in a boxed UI view.
  14. *
  15. * @extends module:ui/editorui/boxed/boxededitoruiview~BoxedEditorUIView
  16. */
  17. export default class ClassicEditorUIView extends BoxedEditorUIView {
  18. /**
  19. * Creates an instance of the classic editor UI view.
  20. *
  21. * @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor#locale} instance.
  22. */
  23. constructor( locale ) {
  24. super( locale );
  25. /**
  26. * A sticky toolbar view instance.
  27. *
  28. * @readonly
  29. * @member {module:ui/toolbar/sticky/stickytoolbarview~StickyToolbarView}
  30. */
  31. this.toolbar = new StickyToolbarView( locale );
  32. /**
  33. * Editable UI view.
  34. *
  35. * @readonly
  36. * @member {module:ui/editableui/inline/inlineeditableuiview~InlineEditableUIView}
  37. */
  38. this.editable = new InlineEditableUIView( locale );
  39. this.top.add( this.toolbar );
  40. this.main.add( this.editable );
  41. }
  42. /**
  43. * @inheritDoc
  44. */
  45. get editableElement() {
  46. return this.editable.element;
  47. }
  48. }