add increase/decrease fontSize commands to the demo

This commit is contained in:
nightwing 2013-08-05 18:51:44 +04:00
commit d2318e99a2

View file

@ -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);
}
}]);