本文整理汇总了TypeScript中tinymce/core/fmt/FormatContainer.isCaretNode函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isCaretNode函数的具体用法?TypeScript isCaretNode怎么用?TypeScript isCaretNode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isCaretNode函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: each
each(formatList, function (format) {
// Check collapsed state if it exists
if ('collapsed' in format && format.collapsed !== isCollapsed) {
return;
}
if (dom.is(node, format.selector) && !isCaretNode(node)) {
setElementFormat(node, format);
found = true;
return false;
}
});
示例2: if
(parent) => {
// We used to skip these, but given that they might be representing empty paragraphs, it probably
// makes sense to treat them just like text nodes
if (nodeName === 'br' || isZeroWidth(elem)) {
return ChildContext.Valid;
} else if (isAnnotation(elem)) {
return ChildContext.Existing;
} else if (isCaretNode(elem)) {
return ChildContext.Caret;
} else if (!FormatUtils.isValid(editor, wrapName, nodeName) || !FormatUtils.isValid(editor, Node.name(parent), wrapName)) {
return ChildContext.InvalidChild;
} else {
return ChildContext.Valid;
}
}
示例3: function
const createNewBlock = function (name?) {
let node = container, block, clonedNode, caretNode;
const textInlineElements = schema.getTextInlineElements();
if (name || parentBlockName === 'TABLE' || parentBlockName === 'HR') {
block = dom.create(name || newBlockName);
setForcedBlockAttrs(editor, block);
} else {
block = parentBlock.cloneNode(false);
}
caretNode = block;
if (Settings.shouldKeepStyles(editor) === false) {
dom.setAttrib(block, 'style', null); // wipe out any styles that came over with the block
dom.setAttrib(block, 'class', null);
} else {
// Clone any parent styles
do {
if (textInlineElements[node.nodeName]) {
if (isCaretNode(node)) {
continue;
}
clonedNode = node.cloneNode(false);
dom.setAttrib(clonedNode, 'id', ''); // Remove ID since it needs to be document unique
if (block.hasChildNodes()) {
clonedNode.appendChild(block.firstChild);
block.appendChild(clonedNode);
} else {
caretNode = clonedNode;
block.appendChild(clonedNode);
}
}
} while ((node = node.parentNode) && node !== editableRoot);
}
emptyBlock(caretNode);
return block;
};
示例4: function
const isElementNode = function (node: Node) {
return node && node.nodeType === 1 && !Bookmarks.isBookmarkNode(node) && !isCaretNode(node) && !NodeType.isBogus(node);
};