本文整理汇总了TypeScript中@ephox/sugar.Selectors类的典型用法代码示例。如果您正苦于以下问题:TypeScript Selectors类的具体用法?TypeScript Selectors怎么用?TypeScript Selectors使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Selectors类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
Chain.op((editor) => {
const wrapperElm = Element.fromHtml('<div class="tinymce-editor"></div>');
Selectors.one('#' + editor.id).each((textareaElm) => {
Insert.wrap(textareaElm, wrapperElm);
});
Selectors.one('.tinymce-mobile-outer-container').each((editorElm) => {
Insert.wrap(editorElm, wrapperElm);
});
}),
示例2: return
return (e) => {
const outerContainer = uiComponents.outerContainer;
Selectors.all('*', outerContainer.element()).forEach((elm) => {
outerContainer.getSystem().getByDom(elm).each((comp: AlloyComponent) => {
if (comp.hasConfigured(Disabling)) {
if (e.mode === 'readonly') {
Disabling.disable(comp);
} else {
Disabling.enable(comp);
}
}
});
});
};
示例3: function
const isResizable = function (elm) {
let selector = editor.settings.object_resizing;
if (selector === false || Env.iOS) {
return false;
}
if (typeof selector !== 'string') {
selector = 'table,img,figure.image,div';
}
if (elm.getAttribute('data-mce-resize') === 'false') {
return false;
}
if (elm === editor.getBody()) {
return false;
}
return Selectors.is(SugarElement.fromDom(elm), selector);
};
示例4:
const cRemove = Chain.op(function (editor) {
const id = editor.id;
editor.remove();
Selectors.one('#' + id).bind(Remove.remove);
});
示例5:
return NewLineUtils.getParentBlock(editor).filter(function (parentBlock) {
return selector.length > 0 && Selectors.is(Element.fromDom(parentBlock), selector);
}).isSome();
示例6:
Chain.op((menu) => {
const checkMarks = Selectors.all('.tox-collection__item-icon');
Assertions.assertEq('only one check mark is displayed for active toggled menu items', 1, checkMarks.length);
})
示例7: function
const isInlineTarget = function (elm) {
return Selectors.is(Element.fromDom(elm), 'a[href],code');
};
示例8: function
const isInlineTarget = function (editor: Editor, elm: Node): boolean {
const selector = EditorSettings.getString(editor, 'inline_boundaries_selector').getOr('a[href],code');
return Selectors.is(Element.fromDom(elm), selector);
};
示例9: function
const children = PredicateFilter.descendants(scope, function (element) {
return Selectors.is(element, selector) && predicate(element);
});