Browse Source

Mouse Wheel zooming

Related #217
pull/291/merge
Ramiro Saenz 9 years ago
parent
commit
3170acf516
  1. 16
      app/Application.js

16
app/Application.js

@ -128,6 +128,22 @@ Ext.define('Rambox.Application', {
]
});
// Mouse Wheel zooming
document.addEventListener('mousewheel', function(e) {
if( e.ctrlKey ) {
var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));
var tabPanel = Ext.cq1('app-main');
if ( tabPanel.items.indexOf(tabPanel.getActiveTab()) === 0 ) return false;
if ( delta === 1 ) { // Zoom In
tabPanel.getActiveTab().zoomIn();
} else { // Zoom Out
tabPanel.getActiveTab().zoomOut();
}
}
});
if ( process.platform !== 'win32' ) {
this.checkUpdate(true);
}

Loading…
Cancel
Save