Browse Source

Merge pull request #491 from weeman1337/ctrl-tab-395

Fixes ctrl + tab cycling
pull/591/head
Ramiro Saenz 8 years ago committed by GitHub
parent
commit
55b9aa53cf
  1. 11
      app/Application.js

11
app/Application.js

@ -44,9 +44,14 @@ Ext.define('Rambox.Application', {
var tabPanel = Ext.cq1('app-main'); var tabPanel = Ext.cq1('app-main');
var activeIndex = tabPanel.items.indexOf(tabPanel.getActiveTab()); var activeIndex = tabPanel.items.indexOf(tabPanel.getActiveTab());
var i = activeIndex + 1; var i = activeIndex + 1;
if ( i >= tabPanel.items.items.length - 1 ) i = 0;
while ( tabPanel.items.items[i].id === 'tbfill' ) i++; // "cycle" (go to the start) when the end is reached or the end is the spacer "tbfill"
tabPanel.setActiveTab( i ); if (i === tabPanel.items.items.length || i === tabPanel.items.items.length - 1 && tabPanel.items.items[i].id === 'tbfill') i = 0;
// skip spacer
while (tabPanel.items.items[i].id === 'tbfill') i++;
tabPanel.setActiveTab(i);
} }
} }
,{ ,{

Loading…
Cancel
Save