keyboard based zooming in electron, fixes #10

This commit is contained in:
azivner 2018-01-22 23:30:25 -05:00
parent a10269a086
commit 27f12a0186

View File

@ -90,6 +90,28 @@ $(document).bind('keydown', "ctrl+shift+down", () => {
return false;
});
$(document).bind('keydown', 'ctrl+-', () => {
if (isElectron()) {
const webFrame = require('electron').webFrame;
if (webFrame.getZoomFactor() > 0.2) {
webFrame.setZoomFactor(webFrame.getZoomFactor() - 0.1);
}
return false;
}
});
$(document).bind('keydown', 'ctrl+=', () => {
if (isElectron()) {
const webFrame = require('electron').webFrame;
webFrame.setZoomFactor(webFrame.getZoomFactor() + 0.1);
return false;
}
});
$("#note-title").bind('keydown', 'return', () => $("#note-detail").focus());
$(window).on('beforeunload', () => {