boxededitorui.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. import EditorUI from '../../../ui/editorui/editorui.js';
  6. /**
  7. * The boxed editor UI controller class. This class controls an editor interface
  8. * consisting of a toolbar and an editable area, enclosed within a box.
  9. *
  10. * // An instance of BoxedEditorUI.
  11. * new BoxedEditorUI( editor );
  12. *
  13. * See {@link ui.editorUI.boxed.BoxedEditorUIView}.
  14. *
  15. * @member ui.editorUI.boxed
  16. * @extends ui.editorUI.EditorUI
  17. */
  18. export default class BoxedEditorUI extends EditorUI {
  19. /**
  20. * Creates a boxed editor UI instance.
  21. *
  22. * @param {core.editor.Editor} editor
  23. */
  24. constructor( editor ) {
  25. super( editor );
  26. this.addCollection( 'top' );
  27. this.addCollection( 'main' );
  28. const config = editor.config;
  29. /**
  30. * The editor's width. Defaults to {@link core.editor.config.ui.width}.
  31. *
  32. * Note: a specific creator that was used must support this setting.
  33. *
  34. * @observable
  35. * @property {Number} width
  36. */
  37. this.set( 'width', config.get( 'ui.width' ) );
  38. /**
  39. * The editor's height. Defaults to {@link core.editor.config.ui.height}.
  40. *
  41. * Note: a specific creator that was used must support this setting.
  42. *
  43. * @observable
  44. * @property {Number} height
  45. */
  46. this.set( 'height', config.get( 'ui.height' ) );
  47. }
  48. }