本文整理匯總了TypeScript中tinymce/core/caret/CaretCandidate.isCaretCandidate函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript isCaretCandidate函數的具體用法?TypeScript isCaretCandidate怎麽用?TypeScript isCaretCandidate使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了isCaretCandidate函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: function
suite.test('isCaretCandidate', function () {
$.each('img input textarea hr table iframe video audio object'.split(' '), function (index, name) {
LegacyUnit.equal(CaretCandidate.isCaretCandidate(document.createElement(name)), true);
});
LegacyUnit.equal(CaretCandidate.isCaretCandidate(document.createTextNode('text')), true);
LegacyUnit.equal(CaretCandidate.isCaretCandidate($('<span contentEditable="false"></span>')[0]), true);
LegacyUnit.equal(CaretCandidate.isCaretCandidate($('<span contentEditable="false" unselectable="true"></span>')[0]), false);
LegacyUnit.equal(CaretCandidate.isCaretCandidate($('<div contentEditable="false"></div>')[0]), true);
LegacyUnit.equal(CaretCandidate.isCaretCandidate($('<table><tr><td>X</td></tr></table>')[0]), true);
LegacyUnit.equal(CaretCandidate.isCaretCandidate($('<span contentEditable="true"></span>')[0]), false);
LegacyUnit.equal(CaretCandidate.isCaretCandidate($('<span></span>')[0]), false);
LegacyUnit.equal(CaretCandidate.isCaretCandidate(document.createComment('text')), false);
LegacyUnit.equal(CaretCandidate.isCaretCandidate($('<span data-mce-caret="1"></span>')[0]), false);
LegacyUnit.equal(CaretCandidate.isCaretCandidate(document.createTextNode(Zwsp.ZWSP)), false);
});
示例2: function
$.each('img input textarea hr table iframe video audio object'.split(' '), function (index, name) {
LegacyUnit.equal(CaretCandidate.isCaretCandidate(document.createElement(name)), true);
});