本文整理汇总了TypeScript中@ephox/sugar.SelectorFilter类的典型用法代码示例。如果您正苦于以下问题:TypeScript SelectorFilter类的具体用法?TypeScript SelectorFilter怎么用?TypeScript SelectorFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SelectorFilter类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: function
const restoreStyles = function () {
const clobberedEls = SelectorFilter.all('[' + attr + ']');
Arr.each(clobberedEls, function (element) {
const restore = Attr.get(element, attr);
if (restore !== 'no-styles') {
Attr.set(element, 'style', restore);
} else {
Attr.remove(element, 'style');
}
Attr.remove(element, attr);
});
};
开发者ID:danielpunkass,项目名称:tinymce,代码行数:12,代码来源:Thor.ts
示例2: function
const navigate = function (dialog, direction) {
const screens = SelectorFilter.descendants(dialog.element(), '.' + Styles.resolve('serialised-dialog-screen'));
SelectorFind.descendant(dialog.element(), '.' + Styles.resolve('serialised-dialog-chain')).each(function (parent) {
if ((spec.state.currentScreen.get() + direction) >= 0 && (spec.state.currentScreen.get() + direction) < screens.length) {
Css.getRaw(parent, 'left').each(function (left) {
const currentLeft = parseInt(left, 10);
const w = Width.get(screens[0]);
Css.set(parent, 'left', (currentLeft - (direction * w)) + 'px');
});
spec.state.currentScreen.set(spec.state.currentScreen.get() + direction);
}
});
};
开发者ID:tinymce,项目名称:tinymce,代码行数:13,代码来源:SerialisedDialog.ts
示例3: function
sz.events.afterResize.bind(function (event) {
const table = event.table();
const dataStyleCells = SelectorFilter.descendants(table, 'td[data-mce-style],th[data-mce-style]');
Arr.each(dataStyleCells, function (cell) {
Attr.remove(cell, 'data-mce-style');
});
selectionRng.each(function (rng) {
editor.selection.setRng(rng);
editor.focus();
});
editor.undoManager.add();
});
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:14,代码来源:ResizeHandler.ts
示例4:
const detectSize = (comp: AlloyComponent, margin: number, selectorClass: string): Option<{ numColumns: number, numRows: number}> => {
const descendants = SelectorFilter.descendants(comp.element(), '.' + selectorClass);
// TODO: This seems to cause performance issues in the emoji dialog
if (descendants.length > 0) {
const columnLength = Arr.findIndex(descendants, (c) => {
const thisTop = c.dom().getBoundingClientRect().top;
const cTop = descendants[0].dom().getBoundingClientRect().top;
return Math.abs(thisTop - cTop) > margin;
}).getOr(descendants.length);
return Option.some({
numColumns: columnLength,
numRows: Math.ceil(descendants.length / columnLength)
});
} else {
return Option.none();
}
};
开发者ID:tinymce,项目名称:tinymce,代码行数:20,代码来源:FlatgridAutodetect.ts
示例5: function
return function (table, target) {
const dataStyleCells = SelectorFilter.descendants(table, 'td[data-mce-style],th[data-mce-style]');
Arr.each(dataStyleCells, function (cell) {
Attr.remove(cell, 'data-mce-style');
});
const wire = lazyWire();
const doc = Element.fromDom(editor.getDoc());
const direction = TableDirection(Direction.directionAt);
const generators = TableFill.cellOperations(mutate, doc, cloneFormats);
return guard(table) ? operation(wire, table, target, generators, direction).bind(function (result) {
Arr.each(result.newRows(), function (row) {
fireNewRow(editor, row.dom());
});
Arr.each(result.newCells(), function (cell) {
fireNewCell(editor, cell.dom());
});
return result.cursor().map(function (cell) {
const rng = editor.dom.createRng();
rng.setStart(cell.dom(), 0);
rng.setEnd(cell.dom(), 0);
return rng;
});
}) : Option.none();
};
开发者ID:abstask,项目名称:tinymce,代码行数:24,代码来源:TableActions.ts
示例6:
Chain.mapper(function (x) {
return SelectorFilter.descendants(x, 'button').length;
}),
开发者ID:tinymce,项目名称:tinymce,代码行数:3,代码来源:DefaultTableToolbarTest.ts
示例7:
const getTableCells = (table) => SelectorFilter.descendants(table, 'td,th');
开发者ID:danielpunkass,项目名称:tinymce,代码行数:1,代码来源:TableDeleteAction.ts
示例8: function
Arr.each(SelectorFilter.descendants(tableElm, 'tr'), function (tr, y) {
Arr.each(SelectorFilter.descendants(tr, 'td,th'), function (td, x) {
fillout(table, skipCellsX(table, x, y), y, tr, td);
});
});
开发者ID:abstask,项目名称:tinymce,代码行数:5,代码来源:SimpleTableModel.ts
示例9: function
const deleteOffscreenSelection = function (rootElement) {
Arr.each(SelectorFilter.descendants(rootElement, '.mce-offscreen-selection'), Remove.remove);
};
开发者ID:abstask,项目名称:tinymce,代码行数:3,代码来源:CefDelete.ts
示例10:
const cAssertApproxRawContent = (expectedHtml) => NamedChain.read('editor', Chain.op((editor) => {
const elm = Replication.deep(Element.fromDom(editor.getBody()));
Arr.each(SelectorFilter.descendants(elm, '*[data-mce-bogus="all"]'), Remove.remove);
const actualHtml = Html.get(elm);
Assertions.assertHtmlStructure('Should expected structure', `<body>${expectedHtml}</body>`, `<body>${actualHtml}</body>`);
}));
开发者ID:danielpunkass,项目名称:tinymce,代码行数:6,代码来源:BookmarksTest.ts
注:本文中的@ephox/sugar.SelectorFilter类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论