本文整理汇总了TypeScript中tinymce/plugins/image/core/ImageData.isFigure函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isFigure函数的具体用法?TypeScript isFigure怎么用?TypeScript isFigure使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isFigure函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getSelectedImage
const writeImageDataToSelection = (editor: Editor, data: ImageData) => {
const image = getSelectedImage(editor);
write((css) => normalizeCss(editor, css), data, image);
syncSrcAttr(editor, image);
if (isFigure(image.parentNode)) {
const figure = image.parentNode as HTMLElement;
splitTextBlock(editor, figure);
editor.selection.select(image.parentNode);
} else {
editor.selection.select(image);
Utils.waitLoadImage(editor, data, image);
}
};
示例2: create
const insertImageAtCaret = (editor: Editor, data: ImageData) => {
const elm = create((css) => normalizeCss(editor, css), data);
editor.dom.setAttrib(elm, 'data-mce-id', '__mcenew');
editor.focus();
editor.selection.setContent(elm.outerHTML);
const insertedElm = editor.dom.select('*[data-mce-id="__mcenew"]')[0];
editor.dom.setAttrib(insertedElm, 'data-mce-id', null);
if (isFigure(insertedElm)) {
const figure = splitTextBlock(editor, insertedElm);
editor.selection.select(figure);
} else {
editor.selection.select(insertedElm);
}
};
示例3: isFigure
const cAssertFigure = Chain.op(function (data: any) {
RawAssertions.assertEq('Parent should be a figure', true, isFigure(data.image.dom().parentNode));
});