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


TypeScript SelectorFind.descendant方法代码示例

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


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

示例1:

        Logger.t('Editor element properties', Step.sync(function () {
          const body = Element.fromDom(document.body);
          const editorElement = SelectorFind.descendant(body, '#' + editor.id + '_parent').getOrDie('No elm');
          const iframeContainerElement = SelectorFind.descendant(body, '#' + editor.id + '_iframecontainer').getOrDie('No elm');

          Assertions.assertDomEq('Should be expected editor container element', editorElement, Element.fromDom(editor.editorContainer));
          Assertions.assertDomEq('Should be expected iframe container element element', iframeContainerElement, Element.fromDom(editor.contentAreaContainer));
        }))
开发者ID:danielpunkass,项目名称:tinymce,代码行数:8,代码来源:InitEditorThemeFunctionIframeTest.ts

示例2: function

  const removeContentEditableSelection = function () {
    if (selectedContentEditableNode) {
      selectedContentEditableNode.removeAttribute('data-mce-selected');
      SelectorFind.descendant(SugarElement.fromDom(editor.getBody()), '#' + realSelectionId).each(Remove.remove);
      selectedContentEditableNode = null;
    }

    SelectorFind.descendant(SugarElement.fromDom(editor.getBody()), '#' + realSelectionId).each(Remove.remove);
    selectedContentEditableNode = null;
  };
开发者ID:danielpunkass,项目名称:tinymce,代码行数:10,代码来源:SelectionOverrides.ts

示例3:

        Logger.t('Editor element properties', Step.sync(function () {
          const body = Element.fromDom(document.body);
          const targetElement = SelectorFind.descendant(body, '#' + editor.id).getOrDie('No elm');
          const editorElement = SelectorFind.descendant(body, '#' + editor.id + '_parent').getOrDie('No elm');

          Assertions.assertDomEq('Should be expected editor container element', editorElement, Element.fromDom(editor.editorContainer));
          Assertions.assertDomEq('Should be expected editor body element', targetElement, Element.fromDom(editor.getBody()));
          Assertions.assertDomEq('Should be expected editor target element', targetElement, Element.fromDom(editor.getElement()));
          Assertions.assertEq('Should be undefined for inline mode', undefined, editor.contentAreaContainer);
        }))
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:10,代码来源:InitEditorThemeFunctionInlineTest.ts

示例4: createViewElement

 return Step.sync(function () {
   const elm = createViewElement(html);
   const location = createLocation(elm, elementPath, offset);
   Assertions.assertEq('Should be a valid location: ' + html, true, location.isSome());
   Assertions.assertEq('Should be expected location', expectedLocationName, locationName(location.getOrDie()));
   Assertions.assertDomEq('Should be expected element', SelectorFind.descendant(elm, expectedInline).getOrDie(), locationElement(location.getOrDie()));
 });
开发者ID:abstask,项目名称:tinymce,代码行数:7,代码来源:BoundaryLocationTest.ts

示例5: measureHeights

      AlloyEvents.runOnAttached((comp) => {
        SelectorFind.descendant(comp.element(), '[role="tabpanel"]').each((tabview) => {
          Css.set(tabview, 'visibility', 'hidden');

          // Determine the maximum heights of each tab
          comp.getSystem().getByDom(tabview).toOption().each((tabviewComp) => {
            const heights = measureHeights(allTabs, tabview, tabviewComp);

            // Calculate the maximum tab height and store it
            const maxTabHeightOpt = getMaxHeight(heights);
            maxTabHeight.set(maxTabHeightOpt);
          });

          // Set an initial height, based on the current size
          updateTabviewHeight(comp.element(), tabview, maxTabHeight);

          // Show the tabs
          Css.remove(tabview, 'visibility');
          showTab(allTabs, comp);

          // Use a delay here and recalculate the height, as we need all the components attached
          // to be able to properly calculate the max height
          Delay.requestAnimationFrame(() => {
            updateTabviewHeight(comp.element(), tabview, maxTabHeight);
          });
        });
      }),
开发者ID:tinymce,项目名称:tinymce,代码行数:27,代码来源:DialogTabHeight.ts

示例6:

 onReceive: (comp, data) => {
   // Send the message to the iframe via postMessage
   SelectorFind.descendant(comp.element(), 'iframe').each((iframeEle) => {
     const iframeWin = iframeEle.dom().contentWindow;
     iframeWin.postMessage(data, iframeDomain);
   });
 }
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:SilverUrlDialog.ts

示例7: function

const setupUiContainer = function (editor) {
  if (editor.settings.ui_container) {
    Env.container = SelectorFind.descendant(Element.fromDom(document.body), editor.settings.ui_container).fold(Fun.constant(null), function (elm) {
      return elm.dom();
    });
  }
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:7,代码来源:FormatControls.ts

示例8:

 const getButton = (selector: string) => {
   return component.getSystem().getByDom(
     SelectorFind.descendant(component.element(), selector).getOrDie(
       `Could not find button defined by: ${selector}`
     )
   ).getOrDie();
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:ToolbarButtonsTest.ts

示例9:

 setActive: (state) => {
   // Toggle the pressed aria state component
   Attr.set(comp.element(), 'aria-pressed', state);
   // Toggle the inner button state, as that's the toggle component of the split button
   SelectorFind.descendant(comp.element(), 'span').each((button) => {
     comp.getSystem().getByDom(button).each((buttonComp) => Toggling.set(buttonComp, state));
   });
 },
开发者ID:tinymce,项目名称:tinymce,代码行数:8,代码来源:ToolbarButtons.ts

示例10: Error

 Chain.op((dialog) => {
   if (Attr.has(dialog, 'aria-labelledby')) {
     const labelledby = Attr.get(dialog, 'aria-labelledby');
     const dialogLabel = SelectorFind.descendant(dialog, '#' + labelledby).getOrDie('Could not find labelledby');
     Assertions.assertEq('Checking label text', ariaLabel, Html.get(dialogLabel));
   } else {
     throw new Error('Dialog did not have an aria-labelledby');
   }
 })
开发者ID:tinymce,项目名称:tinymce,代码行数:9,代码来源:FullScreenPluginTest.ts


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