...
- 커스텀 플러그인을 통해 단축키 설정시 지정된 action외 실행함수를 직접 지정할 수 있습니다.
Code Block | ||
---|---|---|
| ||
window.SynapEditor.addPlugin('customShortcut', function (editor) {
return {
shortcutDef: [{
key: {
windows: 'Alt+Shift+X',
mac: 'Alt+Shift+X'
},
option: {
onExecute: function (editor, e) {
editor.selectionManager.selectAll();
editor.execCommand('textFill', '#ff0000');
editor.selectionManager.documentStart();
editor.selectionRenderer.renderSelection(editor.selectionManager.selection);
}
}
}]
}
}); |
Code Block | ||||
---|---|---|---|---|
| ||||
window.SynapEditor.addPlugin('customShortcut', function (editor) { return { shortcutDef: [{ key: { windows: 'Alt+Shift+X', mac: 'Alt+Shift+X' }, option: { onExecute: function (editor, e) { editor.selectionManager.selectAll(); editor.execCommand('textFill', '#ff0000'); editor.selectionManager.documentStart(); editor.selectionRenderer.renderSelection(editor.selectionManager.selection); } } }] } }); |
...