当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Element.dom方法代码示例

本文整理汇总了TypeScript中@ephox/sugar.Element.dom方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Element.dom方法的具体用法?TypeScript Element.dom怎么用?TypeScript Element.dom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@ephox/sugar.Element的用法示例。


在下文中一共展示了Element.dom方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

    memContainer.getOpt(anyInSystem).each((panel) => {
      const panelW = Width.get(panel.element());
      const panelH = Height.get(panel.element());
      const width = img.dom().naturalWidth;
      const height = img.dom().naturalHeight;
      const zoom = Math.min((panelW) / width, (panelH) / height);

      if (zoom >= 1) {
        zoomState.set(1);
      } else {
        zoomState.set(zoom);
      }
    });
开发者ID:tinymce,项目名称:tinymce,代码行数:13,代码来源:ImagePanel.ts

示例2:

const getMaxTabviewHeight = (dialog: Element, dialogBody: Element) => {
  const rootElm = SelectorFind.ancestor(dialog, '.tox-dialog-wrap').getOr(dialog);
  const isFixed = Css.get(rootElm, 'position') === 'fixed';
  // Get the document or window/viewport height
  let maxHeight;
  if (isFixed) {
    maxHeight = Math.max(document.documentElement.clientHeight, window.innerHeight);
  } else {
    maxHeight = Math.max(document.documentElement.offsetHeight, document.documentElement.scrollHeight);
  }
  // Determine the max dialog body height
  const dialogChrome = dialog.dom().getBoundingClientRect().height - dialogBody.dom().getBoundingClientRect().height;
  return maxHeight - dialogChrome;
};
开发者ID:tinymce,项目名称:tinymce,代码行数:14,代码来源:DialogTabHeight.ts

示例3:

const removeEmpty = (text: Element): Option<Element> => {
  if (text.dom().length === 0) {
    Remove.remove(text);
    return Option.none();
  }
  return Option.some(text);
};
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:SetSelectionContent.ts

示例4:

const trimBr = (first: boolean, block: Element) => {
  CaretFinder.positionIn(first, block.dom())
    .map((position) => position.getNode())
    .map(Element.fromDom)
    .filter(ElementType.isBr)
    .each(Remove.remove);
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:7,代码来源:MergeBlocks.ts

示例5: removeEmptyRoot

const sidelongBlockMerge = (rootNode: Element, fromBlock: Element, toBlock: Element): Option<CaretPosition> => {
  if (Empty.isEmpty(toBlock)) {
    Remove.remove(toBlock);
    if (Empty.isEmpty(fromBlock)) {
      PaddingBr.fillWithPaddingBr(fromBlock);
    }
    return CaretFinder.firstPositionIn(fromBlock.dom());
  }

  const position = CaretFinder.lastPositionIn(toBlock.dom());
  Arr.each(extractChildren(fromBlock), (child) => {
    Insert.append(toBlock, child);
  });
  removeEmptyRoot(rootNode, fromBlock);
  return position;
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:16,代码来源:MergeBlocks.ts

示例6: Event

const fireEvent = (elem: Element, event: string) => {
  let evt;
  if (Type.isFunction(Event)) {
    evt = new Event(event, {
      bubbles: true,
      cancelable: true
    });
  } else { // support IE
    evt = document.createEvent('Event');
    evt.initEvent(event, true, true);
  }
  elem.dom().dispatchEvent(evt);
};
开发者ID:tinymce,项目名称:tinymce,代码行数:13,代码来源:TestLinkUi.ts

示例7: Event

 Chain.op(function (elm: Element) {
   const element: HTMLElement = elm.dom();
   // NOTE we can't fake a paste event here.
   let event;
   if (Type.isFunction(Event)) {
     event = new Event(name, {
       bubbles: true,
       cancelable: true
     });
   } else { // support IE
     event = document.createEvent('Event');
     event.initEvent(name, true, true);
   }
   element.dispatchEvent(event);
 }),
开发者ID:tinymce,项目名称:tinymce,代码行数:15,代码来源:Utils.ts

示例8:

 Chain.op(function (elm: Element) {
   const evt = document.createEvent('HTMLEvents');
   evt.initEvent(name, true, true);
   elm.dom().dispatchEvent(evt);
 }),
开发者ID:tinymce,项目名称:tinymce,代码行数:5,代码来源:CharmapSearchTest.ts


注:本文中的@ephox/sugar.Element.dom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。