Browse Source

Bug fixed in keyboard shortcuts navigation

Related #31
pull/116/head
Ramiro Saenz 9 years ago
parent
commit
b5c1de9fc8
  1. 15
      app/Application.js

15
app/Application.js

@ -38,11 +38,8 @@ Ext.define('Rambox.Application', {
,handler: function(key) {
var tabPanel = Ext.cq1('app-main');
var activeIndex = tabPanel.items.indexOf(tabPanel.getActiveTab());
if ( !tabPanel.items.items[activeIndex + 1] ) {
activeIndex = -1;
} else if ( tabPanel.items.items[activeIndex + 1].tabConfig.xtype === 'tbfill' ) {
activeIndex++;
}
if ( tabPanel.items.items[activeIndex + 1] && tabPanel.items.items[activeIndex + 1].id === 'tbfill' ) activeIndex++;
if ( !tabPanel.items.items[activeIndex + 1] ) activeIndex = -1;
tabPanel.setActiveTab( activeIndex + 1 );
}
}
@ -54,11 +51,9 @@ Ext.define('Rambox.Application', {
,handler: function(key) {
var tabPanel = Ext.cq1('app-main');
var activeIndex = tabPanel.items.indexOf(tabPanel.getActiveTab());
if ( !tabPanel.items.items[activeIndex - 1] ) {
activeIndex = tabPanel.items.length;
} else if ( tabPanel.items.items[activeIndex - 1].tabConfig.xtype === 'tbfill' ) {
activeIndex--;
}
if ( tabPanel.items.items[activeIndex - 1] && tabPanel.items.items[activeIndex - 1].id === 'tbfill' ) activeIndex--;
if ( !tabPanel.items.items[activeIndex - 1] && tabPanel.items.items.length !== 2 ) activeIndex = tabPanel.items.items.length;
if ( tabPanel.items.items.length === 2 ) activeIndex = 1;
tabPanel.setActiveTab( activeIndex - 1 );
}
}

Loading…
Cancel
Save