Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

getContentEditableContainer.js 848 B

3 лет назад
12345678910111213141516171819202122232425
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @format
  8. *
  9. * @emails oncall+draft_js
  10. */
  11. 'use strict';
  12. var invariant = require("fbjs/lib/invariant");
  13. var isHTMLElement = require("./isHTMLElement");
  14. function getContentEditableContainer(editor) {
  15. var editorNode = editor.editorContainer;
  16. !editorNode ? process.env.NODE_ENV !== "production" ? invariant(false, 'Missing editorNode') : invariant(false) : void 0;
  17. !isHTMLElement(editorNode.firstChild) ? process.env.NODE_ENV !== "production" ? invariant(false, 'editorNode.firstChild is not an HTMLElement') : invariant(false) : void 0;
  18. var htmlElement = editorNode.firstChild;
  19. return htmlElement;
  20. }
  21. module.exports = getContentEditableContainer;