本文整理匯總了TypeScript中@ephox/sugar.InsertAll類的典型用法代碼示例。如果您正苦於以下問題:TypeScript InsertAll類的具體用法?TypeScript InsertAll怎麽用?TypeScript InsertAll使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了InsertAll類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: function
const createDomTable = function (table, rows) {
const tableElement = Replication.shallow(table.element());
const tableBody = Element.fromTag('tbody');
InsertAll.append(tableBody, rows);
Insert.append(tableElement, tableBody);
return tableElement;
};
示例2: indentSelectedEntries
Arr.each(entrySets, (entrySet) => {
indentSelectedEntries(entrySet.entries, indentation);
const composedLists = composeEntries(editor, entrySet.entries);
Arr.each(composedLists, (composedList) => {
fireListEvent(editor, indentation === Indentation.Indent ? ListAction.IndentList : ListAction.OutdentList, composedList.dom());
});
InsertAll.before(entrySet.sourceList, composedLists);
Remove.remove(entrySet.sourceList);
});
示例3:
const wrapWithSiblings = (dom: DOMUtils, node: Node, next: boolean, name: string, attrs?): Node => {
const start = Element.fromDom(node);
const wrapper = Element.fromDom(dom.create(name, attrs));
const siblings = next ? Traverse.nextSiblings(start) : Traverse.prevSiblings(start);
InsertAll.append(wrapper, siblings);
if (next) {
Insert.before(start, wrapper);
Insert.prepend(wrapper, start);
} else {
Insert.after(start, wrapper);
Insert.append(wrapper, start);
}
return wrapper.dom();
};
示例4: function
const update = function () {
clear();
const rectangles = Rectangles.getRectangles(win);
const spans = Arr.map(rectangles, make);
InsertAll.append(container, spans);
};
示例5: indentSelectedEntries
Arr.each(entrySets, (entrySet) => {
indentSelectedEntries(entrySet.entries, indentation);
InsertAll.before(entrySet.sourceList, composeEntries(editor, entrySet.entries));
Remove.remove(entrySet.sourceList);
});
示例6:
const createItem = (scope: Document, attr: Record<string, any>, content: Element[]): Element => {
const item = Element.fromTag('li', scope);
Attr.setAll(item, attr);
InsertAll.append(item, content);
return item;
};