25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

19 lines
460 B

  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. * @flow
  9. * @emails oncall+draft_js
  10. */
  11. function getWindowForNode(node: ?Node): any {
  12. if (!node || !node.ownerDocument || !node.ownerDocument.defaultView) {
  13. return window;
  14. }
  15. return node.ownerDocument.defaultView;
  16. }
  17. module.exports = getWindowForNode;