Browse Source

Update service align on tab position change #1249

If a tab is moved to the right side, the align field must reflect
the new position.
pull/1603/head
Manuel Muradas 7 years ago
parent
commit
7328d3f02c
  1. 8
      app/view/main/MainController.js

8
app/view/main/MainController.js

@ -42,14 +42,20 @@ Ext.define('Rambox.view.main.MainController', {
console.log('Updating Tabs positions...');
var store = Ext.getStore('Services');
var align = 'left';
store.suspendEvent('remove');
Ext.each(tabPanel.items.items, function(t, i) {
if ( t.id !== 'ramboxTab' && t.id !== 'tbfill' && t.record.get('enabled') ) {
var rec = store.getById(t.record.get('id'));
if ( rec.get('align') === 'right' ) i--;
if ( align === 'right' ) i--;
rec.set('align', align);
rec.set('position', i);
rec.save();
}
else if ( t.id === 'tbfill' ) {
align = 'right';
}
});
store.load();

Loading…
Cancel
Save