本文整理汇总了TypeScript中wed/editor.Editor.setLabelVisibilityLevel方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Editor.setLabelVisibilityLevel方法的具体用法?TypeScript Editor.setLabelVisibilityLevel怎么用?TypeScript Editor.setLabelVisibilityLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wed/editor.Editor
的用法示例。
在下文中一共展示了Editor.setLabelVisibilityLevel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getAttributeValuesFor
"attribute is not visible", () => {
// Reduce visibility to 0 so that no attribute is visible.
editor.setLabelVisibilityLevel(0);
const attrVals = getAttributeValuesFor(ps[9]);
caretManager.setCaret(attrVals[0].firstChild, 0);
const menu = editor.window.document.
getElementsByClassName("wed-context-menu")[0];
assert.isUndefined(menu, "the menu should not exist");
});
示例2: it
it("the attributes error are not linked", async () => {
editor.setLabelVisibilityLevel(0);
await processRunner.onCompleted();
let cases = 0;
for (const { ev, item } of controller.copyErrorList()) {
if (!isAttr(ev.node)) {
continue;
}
assert.isTrue(item!.getElementsByTagName("a").length === 0,
"there should be no link in the item");
assert.equal(
item!.title,
"This error belongs to an attribute which is not currently displayed.",
"the item should have the right title");
cases++;
}
assert.equal(cases, 5);
});