本文整理汇总了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;
}
});
开发者ID:danielpunkass,项目名称:tinymce,代码行数:12,代码来源:ApplyFormat.ts
示例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;
}
}
开发者ID:danielpunkass,项目名称:tinymce,代码行数:15,代码来源:AnnotationContext.ts
示例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;
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:42,代码来源:InsertBlock.ts
示例4: function
const isElementNode = function (node: Node) {
return node && node.nodeType === 1 && !Bookmarks.isBookmarkNode(node) && !isCaretNode(node) && !NodeType.isBogus(node);
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:3,代码来源:ApplyFormat.ts
注:本文中的tinymce/core/fmt/FormatContainer.isCaretNode函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论