rooteditableelement.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /**
  6. * @module engine/view/rooteditableelement
  7. */
  8. import EditableElement from './editableelement.js';
  9. /**
  10. * Class representing a single root in the data view. A root can be either {@link #isReadOnly editable or read-only}, but
  11. * in both cases it is called "an editable". Roots can contain other {@link module:engine/view/editableelement~EditableElement editable
  12. * elements}
  13. * making them "nested editables".
  14. *
  15. * @extends module:engine/view/editableelement~EditableElement
  16. */
  17. export default class RootEditableElement extends EditableElement {
  18. /**
  19. * Creates root editable element.
  20. *
  21. * @param {module:engine/view/document~Document} document {@link module:engine/view/document~Document} that is an owner of the root.
  22. * @param {String} name Node name.
  23. * @param {String} [rootName='main'] Root name inside parent {@link module:engine/view/document~Document}.
  24. */
  25. constructor( document, name, rootName = 'main' ) {
  26. super( document, name );
  27. /**
  28. * Name of this root inside {@link module:engine/view/document~Document} that is an owner of this root.
  29. *
  30. * @readonly
  31. * @member {String}
  32. */
  33. this.rootName = rootName;
  34. }
  35. }