本文整理汇总了TypeScript中tinymce/core/api/dom/DOMUtils.DOMUtils.select方法的典型用法代码示例。如果您正苦于以下问题:TypeScript DOMUtils.select方法的具体用法?TypeScript DOMUtils.select怎么用?TypeScript DOMUtils.select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tinymce/core/api/dom/DOMUtils.DOMUtils
的用法示例。
在下文中一共展示了DOMUtils.select方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
const resolveIndex = (dom: DOMUtils, bookmark: IndexBookmark) => {
return Option.from(dom.select(bookmark.name)[bookmark.index]).map((elm) => {
const rng = dom.createRng();
rng.selectNode(elm);
return rng;
});
};
示例2: function
const findIndex = function (dom: DOMUtils, name: string, element: Element) {
let count = 0;
Tools.each(dom.select(name), function (node) {
if (node.getAttribute('data-mce-bogus') === 'all') {
return;
}
if (node === element) {
return false;
}
count++;
});
return count;
};
示例3: function
const getTDTHOverallStyle = function (dom: DOMUtils, elm: Element, name: string): string {
const cells = dom.select('td,th', elm);
let firstChildStyle: string;
const checkChildren = function (firstChildStyle: string, elms: Element[]) {
for (let i = 0; i < elms.length; i++) {
const currentStyle = dom.getStyle(elms[i], name);
if (typeof firstChildStyle === 'undefined') {
firstChildStyle = currentStyle;
}
if (firstChildStyle !== currentStyle) {
return '';
}
}
return firstChildStyle;
};
firstChildStyle = checkChildren(firstChildStyle, cells);
return firstChildStyle;
};
示例4: function
const toggleInlines = function (isInlineTarget: NodePredicate, dom: DOMUtils, elms: Node[]) {
const selectedInlines = Arr.filter(dom.select('*[data-mce-selected="inline-boundary"]'), isInlineTarget);
const targetInlines = Arr.filter(elms, isInlineTarget);
Arr.each(Arr.difference(selectedInlines, targetInlines), Fun.curry(setSelected, false));
Arr.each(Arr.difference(targetInlines, selectedInlines), Fun.curry(setSelected, true));
};