add increase/decrease fontSize commands to the demo
This commit is contained in:
parent
d884b44d48
commit
d2318e99a2
1 changed files with 20 additions and 0 deletions
|
|
@ -177,6 +177,26 @@ env.editor.commands.addCommands([{
|
|||
editor.showKeyboardShortcuts()
|
||||
})
|
||||
}
|
||||
}, {
|
||||
name: "increaseFontSize",
|
||||
bindKey: "Ctrl-+",
|
||||
exec: function(editor) {
|
||||
var size = parseInt(editor.getFontSize(), 10) || 12;
|
||||
editor.setFontSize(size + 1);
|
||||
}
|
||||
}, {
|
||||
name: "decreaseFontSize",
|
||||
bindKey: "Ctrl+-",
|
||||
exec: function(editor) {
|
||||
var size = parseInt(editor.getFontSize(), 10) || 12;
|
||||
editor.setFontSize(Math.max(size - 1 || 1));
|
||||
}
|
||||
}, {
|
||||
name: "resetFontSize",
|
||||
bindKey: "Ctrl+0",
|
||||
exec: function(editor) {
|
||||
editor.setFontSize(12);
|
||||
}
|
||||
}]);
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue