本文整理匯總了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);
});