• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript sugar.SelectorFilter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: function

const restoreStyles = function () {
  const clobberedEls = SelectorFilter.all('[' + attr + ']');
  Arr.each(clobberedEls, function (element) {
    const restore = Attr.get(element, attr);
    if (restore !== 'no-styles') {
      Attr.set(element, 'style', restore);
    } else {
      Attr.remove(element, 'style');
    }
    Attr.remove(element, attr);
  });
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:12,代码来源:Thor.ts


示例2: function

 const navigate = function (dialog, direction) {
   const screens = SelectorFilter.descendants(dialog.element(), '.' + Styles.resolve('serialised-dialog-screen'));
   SelectorFind.descendant(dialog.element(), '.' + Styles.resolve('serialised-dialog-chain')).each(function (parent) {
     if ((spec.state.currentScreen.get() + direction) >= 0 && (spec.state.currentScreen.get() + direction) < screens.length) {
       Css.getRaw(parent, 'left').each(function (left) {
         const currentLeft = parseInt(left, 10);
         const w = Width.get(screens[0]);
         Css.set(parent, 'left', (currentLeft - (direction * w)) + 'px');
       });
       spec.state.currentScreen.set(spec.state.currentScreen.get() + direction);
     }
   });
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:13,代码来源:SerialisedDialog.ts


示例3: function

      sz.events.afterResize.bind(function (event) {
        const table = event.table();
        const dataStyleCells = SelectorFilter.descendants(table, 'td[data-mce-style],th[data-mce-style]');
        Arr.each(dataStyleCells, function (cell) {
          Attr.remove(cell, 'data-mce-style');
        });

        selectionRng.each(function (rng) {
          editor.selection.setRng(rng);
          editor.focus();
        });

        editor.undoManager.add();
      });
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:14,代码来源:ResizeHandler.ts


示例4:

const detectSize = (comp: AlloyComponent, margin: number, selectorClass: string): Option<{ numColumns: number, numRows: number}> => {
  const descendants = SelectorFilter.descendants(comp.element(), '.' + selectorClass);

  // TODO: This seems to cause performance issues in the emoji dialog
  if (descendants.length > 0) {
    const columnLength = Arr.findIndex(descendants, (c) => {
      const thisTop = c.dom().getBoundingClientRect().top;
      const cTop = descendants[0].dom().getBoundingClientRect().top;
      return Math.abs(thisTop - cTop) > margin;

    }).getOr(descendants.length);

    return Option.some({
      numColumns: columnLength,
      numRows: Math.ceil(descendants.length / columnLength)
    });
  } else {
    return Option.none();
  }
};
开发者ID:tinymce,项目名称:tinymce,代码行数:20,代码来源:FlatgridAutodetect.ts


示例5: function

 return function (table, target) {
   const dataStyleCells = SelectorFilter.descendants(table, 'td[data-mce-style],th[data-mce-style]');
   Arr.each(dataStyleCells, function (cell) {
     Attr.remove(cell, 'data-mce-style');
   });
   const wire = lazyWire();
   const doc = Element.fromDom(editor.getDoc());
   const direction = TableDirection(Direction.directionAt);
   const generators = TableFill.cellOperations(mutate, doc, cloneFormats);
   return guard(table) ? operation(wire, table, target, generators, direction).bind(function (result) {
     Arr.each(result.newRows(), function (row) {
       fireNewRow(editor, row.dom());
     });
     Arr.each(result.newCells(), function (cell) {
       fireNewCell(editor, cell.dom());
     });
     return result.cursor().map(function (cell) {
       const rng = editor.dom.createRng();
       rng.setStart(cell.dom(), 0);
       rng.setEnd(cell.dom(), 0);
       return rng;
     });
   }) : Option.none();
 };
开发者ID:abstask,项目名称:tinymce,代码行数:24,代码来源:TableActions.ts


示例6:

 Chain.mapper(function (x) {
   return SelectorFilter.descendants(x, 'button').length;
 }),
开发者ID:tinymce,项目名称:tinymce,代码行数:3,代码来源:DefaultTableToolbarTest.ts


示例7:

const getTableCells = (table) => SelectorFilter.descendants(table, 'td,th');
开发者ID:danielpunkass,项目名称:tinymce,代码行数:1,代码来源:TableDeleteAction.ts


示例8: function

 Arr.each(SelectorFilter.descendants(tableElm, 'tr'), function (tr, y) {
   Arr.each(SelectorFilter.descendants(tr, 'td,th'), function (td, x) {
     fillout(table, skipCellsX(table, x, y), y, tr, td);
   });
 });
开发者ID:abstask,项目名称:tinymce,代码行数:5,代码来源:SimpleTableModel.ts


示例9: function

const deleteOffscreenSelection = function (rootElement) {
  Arr.each(SelectorFilter.descendants(rootElement, '.mce-offscreen-selection'), Remove.remove);
};
开发者ID:abstask,项目名称:tinymce,代码行数:3,代码来源:CefDelete.ts


示例10:

 const cAssertApproxRawContent = (expectedHtml) => NamedChain.read('editor', Chain.op((editor) => {
   const elm = Replication.deep(Element.fromDom(editor.getBody()));
   Arr.each(SelectorFilter.descendants(elm, '*[data-mce-bogus="all"]'), Remove.remove);
   const actualHtml = Html.get(elm);
   Assertions.assertHtmlStructure('Should expected structure', `<body>${expectedHtml}</body>`, `<body>${actualHtml}</body>`);
 }));
开发者ID:danielpunkass,项目名称:tinymce,代码行数:6,代码来源:BookmarksTest.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript sugar.SelectorFind类代码示例发布时间:2022-05-28
下一篇:
TypeScript sugar.SelectorExists类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap