當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript sugar.SelectorFind類代碼示例

本文整理匯總了TypeScript中@ephox/sugar.SelectorFind的典型用法代碼示例。如果您正苦於以下問題:TypeScript SelectorFind類的具體用法?TypeScript SelectorFind怎麽用?TypeScript SelectorFind使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了SelectorFind類的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:

        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

示例3: 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

示例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:

 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

示例6: 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

示例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類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。