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


TypeScript Arr.last方法代码示例

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


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

示例1: function

const getNewRowCursorPosition = function (editor, table) {
  const rows = SelectorFilter.descendants(table, 'tr');
  return Arr.last(rows).bind(function (last) {
    return SelectorFind.descendant(last, 'td,th').map(function (first) {
      return getCellFirstCursorPosition(editor, first);
    });
  });
};
开发者ID:abstask,项目名称:tinymce,代码行数:8,代码来源:TabContext.ts

示例2: createSection

const createJoinedSections = (scope: Document, length: number, listType: ListType): Section[] => {
  const sections: Section[] = [];
  for (let i = 0; i < length; i++) {
    const newSection = createSection(scope, listType);
    Arr.last(sections).each((lastSection) => joinSections(lastSection, newSection));
    sections.push(newSection);
  }
  return sections;
};
开发者ID:mdgbayly,项目名称:tinymce,代码行数:9,代码来源:ComposeList.ts

示例3:

const populateSegments = (segments: Segment[], entry: Entry): void => {
  for (let i = 0; i < segments.length - 1; i++) {
    Css.set(segments[i].item, 'list-style-type', 'none');
  }
  Arr.last(segments).each((segment) => {
    Attr.setAll(segment.list, entry.listAttributes);
    Attr.setAll(segment.item, entry.itemAttributes);
    InsertAll.append(segment.item, entry.content);
  });
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:10,代码来源:ComposeList.ts

示例4: createJoinedSections

const writeDeep = (scope: Document, outline: Section[], entry: Entry): Section[] => {
  const newSections = createJoinedSections(scope, entry.depth - outline.length, entry.listType);
  populateSections(newSections, entry);

  Options.liftN([
    Arr.last(outline),
    Arr.head(newSections)
  ], joinSections);
  return outline.concat(newSections);
};
开发者ID:mdgbayly,项目名称:tinymce,代码行数:10,代码来源:ComposeList.ts

示例5: setItem

const writeShallow = (scope: Document, outline: Section[], entry: Entry): Section[] => {
  const newOutline = outline.slice(0, entry.depth);

  Arr.last(newOutline).each((section) => {
    setItem(section, createItem(scope, entry.itemAttributes, entry.content));
    normalizeSection(section, entry);
  });

  return newOutline;
};
开发者ID:mdgbayly,项目名称:tinymce,代码行数:10,代码来源:ComposeList.ts

示例6: createItem

const writeShallow = (scope: Document, cast: Segment[], entry: Entry): Segment[] => {
  const newCast = cast.slice(0, entry.depth);

  Arr.last(newCast).each((segment) => {
    const item = createItem(scope, entry.itemAttributes, entry.content);
    appendItem(segment, item);
    normalizeSegment(segment, entry);
  });

  return newCast;
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:11,代码来源:ComposeList.ts

示例7:

 AlloyEvents.run<BackwardSlideEvent>(backSlideEvent, (comp, se) => {
   Arr.last(stack.get()).each((last) => {
     stack.set(stack.get().slice(0, stack.get().length - 1));
     AlloyTriggers.emitWith(comp, changeSlideEvent, {
       // Because we are using premade, we should have access to the same element
       // to give focus (although it isn't working)
       contents: GuiFactory.premade(last.bar),
       focus: last.focus
     });
   });
 }),
开发者ID:tinymce,项目名称:tinymce,代码行数:11,代码来源:ContextUi.ts

示例8: return

 return () => {
   const from = forward ? CaretPosition.fromRangeEnd(editor.selection.getRng()) : CaretPosition.fromRangeStart(editor.selection.getRng());
   const result = forward ? getPositionsUntilNextLine(editor.getBody(), from) : getPositionsUntilPreviousLine(editor.getBody(), from);
   const to = forward ? Arr.last(result.positions) : Arr.head(result.positions);
   return to.filter(isCefPosition(forward)).fold(
     Fun.constant(false),
     (pos) => {
       editor.selection.setRng(pos.toRange());
       return true;
     }
   );
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:12,代码来源:CefNavigation.ts

示例9:

const addContextMenuGroup = (xs: Array<MenuItem>, groupItems: Array<MenuItem>) => {
  // Skip if there are no items
  if (groupItems.length === 0) {
    return xs;
  }

  // Only add a separator at the beginning if the last item isn't a separator
  const lastMenuItem = Arr.last(xs).filter((item) => !isSeparator(item));
  const before = lastMenuItem.fold(
    () => [],
    (_) => [ separator ]
  );
  return xs.concat(before).concat(groupItems).concat([ separator ]);
};
开发者ID:tinymce,项目名称:tinymce,代码行数:14,代码来源:SilverContextMenu.ts


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