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


TypeScript Arr.each方法代码示例

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


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

示例1: function

 const onMousedown = DomEvent.bind(Element.fromDom(document), 'mousedown', function (evt) {
   Arr.each([ mothership, uiMothership ], function (ship) {
     ship.broadcastOn([ Channels.dismissPopups() ], {
       target: evt.target()
     });
   });
 });
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:Events.ts

示例2: function

 editor.serializer.addNodeFilter('details', function (elms) {
   Arr.each(elms, function (details) {
     const open = details.attr('data-mce-open');
     details.attr('open', Type.isString(open) ? open : null);
     details.attr('data-mce-open', null);
   });
 });
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:DetailsElement.ts

示例3:

 const getStr = (sections: TestSection[]) => {
   const r = { };
   Arr.each(sections, (section) => {
     r[section.setting.key] = section.setting.value.getOr('{ default }');
   });
   return JSON.stringify(r, null, 2);
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:DialogSectionsTest.ts

示例4: function

const removeTrailingBr = function (elm) {
  const allBrs = SelectorFilter.descendants(elm, 'br');
  const brs = Arr.filter(getLastChildren(elm).slice(-1), ElementType.isBr);
  if (allBrs.length === brs.length) {
    Arr.each(brs, Remove.remove);
  }
};
开发者ID:abstask,项目名称:tinymce,代码行数:7,代码来源:PaddingBr.ts

示例5: function

const removeDataStyle = (table) => {
  const dataStyleCells = SelectorFilter.descendants(table, 'td[data-mce-style],th[data-mce-style]');
  Attr.remove(table, 'data-mce-style');
  Arr.each(dataStyleCells, function (cell) {
    Attr.remove(cell, 'data-mce-style');
  });
};
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:Util.ts

示例6: updateCallbacks

  const onNodeChange = Throttler.last(() => {
    const callbackMap = changeCallbacks.get();
    const annotations = Arr.sort(Obj.keys(callbackMap));
    Arr.each(annotations, (name) => {
      updateCallbacks(name, (data) => {
        const prev = data.previous.get();
        identify(editor, Option.some(name)).fold(
          () => {
            if (prev.isSome()) {
              // Changed from something to nothing.
              fireNoAnnotation(name);
              data.previous.set(Option.none());
            }
          },
          ({ uid, name, elements }) => {
            // Changed from a different annotation (or nothing)
            if (! prev.is(uid)) {
              fireCallbacks(name, uid, elements);
              data.previous.set(Option.some(uid));
            }
          }
        );

        return {
          previous: data.previous,
          listeners: data.listeners
        };
      });
    });
  }, 30);
开发者ID:danielpunkass,项目名称:tinymce,代码行数:30,代码来源:AnnotationChanges.ts

示例7: function

const hide = function (editor, body) {
  const nodeList = editor.dom.select(Data.selector, body);

  Arr.each(nodeList, function (node) {
    editor.dom.remove(node, 1);
  });
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:7,代码来源:VisualChars.ts

示例8: identifyParserNode

 editor.serializer.addNodeFilter('span', (spans) => {
   Arr.each(spans, (span) => {
     identifyParserNode(span).each((settings) => {
       if (settings.persistent === false) { span.unwrap(); }
     });
   });
 });
开发者ID:danielpunkass,项目名称:tinymce,代码行数:7,代码来源:AnnotationFilter.ts

示例9: handler

  const resetTargets = () => {
    // Reset the targets
    targets.set(Thunk.cached(findTargets)());

    // Trigger change handlers
    Arr.each(changeHandlers.get(), (handler) => handler());
  };
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:SelectionTargets.ts

示例10: fireNewRow

  Arr.each(SelectorFilter.descendants(table, 'tr'), (row) => {
    fireNewRow(editor, row.dom());

    Arr.each(SelectorFilter.descendants(row, 'th,td'), (cell) => {
      fireNewCell(editor, cell.dom());
    });
  });
开发者ID:danielpunkass,项目名称:tinymce,代码行数:7,代码来源:InsertTable.ts


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