本文整理匯總了TypeScript中@ephox/agar.Mouse.sContextMenuOn方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Mouse.sContextMenuOn方法的具體用法?TypeScript Mouse.sContextMenuOn怎麽用?TypeScript Mouse.sContextMenuOn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@ephox/agar.Mouse
的用法示例。
在下文中一共展示了Mouse.sContextMenuOn方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: TinyUi
TinyLoader.setup(function (editor, onSuccess, onFailure) {
const tinyUi = TinyUi(editor);
const tinyApis = TinyApis(editor);
Pipeline.async({}, [
Logger.t('Context menu click on text', GeneralSteps.sequence([
tinyApis.sSetContent('<p>a</p>'),
tinyApis.sSetSelection([0, 0], 0, [0, 0], 1),
Mouse.sContextMenuOn(Element.fromDom(editor.getBody()), 'p'),
tinyUi.sWaitForUi('wait for context', 'div.mce-contextmenu'),
tinyUi.sClickOnUi('click on link in context', 'div.mce-contextmenu span:contains("Bold")'),
tinyApis.sAssertContentStructure(ApproxStructure.build(function (s, str) {
return s.element('body', {
children: [
s.element('p', {
children: [
s.element('strong', {
children: [
s.text(str.is('a'))
]
})
]
})
]
});
}))
])),
Logger.t('Do not select image if the context menu click is inside the currently selected range', GeneralSteps.sequence([
tinyApis.sSetContent('<p>a<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAAAAACH5BAAAAAAALAAAAAABAAEAAAICTAEAOw==" width="100" height="100"></p>'),
tinyApis.sSetSelection([0, 0], 0, [0], 2),
sContextMenuClickInMiddleOf(editor, [0, 1]),
tinyApis.sAssertSelection([0, 0], 0, [0], 2)
]))
], onSuccess, onFailure);
}, {