本文整理汇总了TypeScript中vs/editor/common/config/config.findFocusedEditor函数的典型用法代码示例。如果您正苦于以下问题:TypeScript findFocusedEditor函数的具体用法?TypeScript findFocusedEditor怎么用?TypeScript findFocusedEditor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了findFocusedEditor函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: execCommandToHandler
function execCommandToHandler(actionId: string, browserCommand: string, accessor: ServicesAccessor, args: any): void {
let focusedEditor = findFocusedEditor(actionId, accessor, false);
// Only if editor text focus (i.e. not if editor has widget focus).
if (focusedEditor && focusedEditor.isFocused()) {
focusedEditor.trigger('keyboard', actionId, args);
return;
}
document.execCommand(browserCommand);
}
示例2: runCommand
public runCommand(accessor:ServicesAccessor, args: any): void {
let focusedEditor = findFocusedEditor(this.id, accessor, false);
// Only if editor text focus (i.e. not if editor has widget focus).
if (focusedEditor && focusedEditor.isFocused()) {
focusedEditor.trigger('keyboard', this.id, args);
return;
}
document.execCommand(this.browserCommand);
}
示例3: execCommandToHandler
function execCommandToHandler(actionId: string, browserCommand: string, accessor: ServicesAccessor, args: any): void {
// If editor text focus
if (args.context[editorCommon.KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS]) {
var focusedEditor = findFocusedEditor(actionId, accessor, args, false);
if (focusedEditor) {
focusedEditor.trigger('keyboard', actionId, args);
return;
}
}
document.execCommand(browserCommand);
}