本文整理汇总了TypeScript中tinymce/core/caret/CaretContainer.isCaretContainerBlock函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isCaretContainerBlock函数的具体用法?TypeScript isCaretContainerBlock怎么用?TypeScript isCaretContainerBlock使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isCaretContainerBlock函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
suite.test('isCaretContainerBlock', function () {
LegacyUnit.equal(CaretContainer.isCaretContainerBlock(document.createTextNode('text')), false);
LegacyUnit.equal(CaretContainer.isCaretContainerBlock(DomQuery('<span></span>')[0]), false);
LegacyUnit.equal(CaretContainer.isCaretContainerBlock(DomQuery('<span data-mce-caret="1"></span>')[0]), true);
LegacyUnit.equal(CaretContainer.isCaretContainerBlock(DomQuery('<span data-mce-caret="1">a</span>')[0].firstChild), true);
LegacyUnit.equal(CaretContainer.isCaretContainerBlock(document.createTextNode(Zwsp.ZWSP)), false);
});
示例2: setupHtml
Step.sync(function () {
setupHtml('<span contentEditable="false">1</span><span contentEditable="false">2</span>');
CaretContainer.insertBlock('p', getRoot().childNodes[1], true);
Assertions.assertEq('Should be block container', true, CaretContainer.isCaretContainerBlock(getRoot().childNodes[1]));
const pos = CaretContainerRemove.removeAndReposition(getRoot().childNodes[1], new CaretPosition(getRoot(), 3));
Assertions.assertEq('Should be changed offset', 2, pos.offset());
Assertions.assertDomEq('Should be unchanged container', Element.fromDom(getRoot()), Element.fromDom(pos.container()));
Assertions.assertEq('Should not be block container', false, CaretContainer.isCaretContainerBlock(getRoot().childNodes[1]));
})
示例3: function
suite.test('left/right over cE=false block', function (editor) {
editor.setContent('<p contenteditable="false">1</p>');
editor.selection.select(editor.$('p[contenteditable=false]')[0]);
leftArrow(editor);
LegacyUnit.equal(editor.getContent(), '<p contenteditable="false">1</p>');
LegacyUnit.equal(CaretContainer.isCaretContainerBlock(editor.selection.getRng().startContainer), true);
rightArrow(editor);
LegacyUnit.equal(editor.getContent(), '<p contenteditable="false">1</p>');
LegacyUnit.equalDom(editor.selection.getNode(), editor.$('p[contenteditable=false]')[0]);
rightArrow(editor);
LegacyUnit.equal(editor.getContent(), '<p contenteditable="false">1</p>');
LegacyUnit.equal(CaretContainer.isCaretContainerBlock(editor.selection.getRng().startContainer), true);
});