From 207bc4e25d4c57e711f5571f03b8723455a0096a Mon Sep 17 00:00:00 2001 From: Ramiro Saenz Date: Tue, 12 Jul 2016 21:13:45 -0300 Subject: [PATCH] Missing code for commit e8ba973e8e4dbf72136e756b3146063613384fdc --- app/view/main/MainController.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/app/view/main/MainController.js b/app/view/main/MainController.js index f3eec76e..14a53393 100644 --- a/app/view/main/MainController.js +++ b/app/view/main/MainController.js @@ -133,7 +133,9 @@ Ext.define('Rambox.view.main.MainController', { ,notifications: formValues.notifications ,muted: formValues.muted }); + // Change the title of the Tab Ext.getCmp('tab_'+record.get('id')).setTitle(formValues.serviceName); + // Change the align of the Tab if ( oldData.align !== formValues.align ) { if ( formValues.align === 'left' ) { me.getView().moveBefore(Ext.getCmp('tab_'+record.get('id')), Ext.getCmp('tbfill')); @@ -305,13 +307,23 @@ Ext.define('Rambox.view.main.MainController', { var formValues = win.down('form').getValues(); if ( edit ) { + var oldData = record.getData(); record.set({ name: formValues.serviceName ,align: formValues.align ,notifications: formValues.notifications ,muted: formValues.muted }); + // Change the title of the Tab Ext.getCmp('tab_'+record.get('id')).setTitle(formValues.serviceName); + // Change the align of the Tab + if ( oldData.align !== formValues.align ) { + if ( formValues.align === 'left' ) { + me.getView().moveBefore(Ext.getCmp('tab_'+record.get('id')), Ext.getCmp('tbfill')); + } else { + me.getView().moveAfter(Ext.getCmp('tab_'+record.get('id')), Ext.getCmp('tbfill')); + } + } } else { var service = Ext.create('Rambox.model.Service', { type: record.get('id') @@ -561,6 +573,7 @@ Ext.define('Rambox.view.main.MainController', { var formValues = win.down('form').getValues(); if ( edit ) { + var oldData = record.getData(); // If users change the URL, we change the URL of the Webview if ( record.get('url') !== formValues.url ) Ext.getCmp('tab_'+record.get('id')).down('component').el.dom.loadURL(formValues.url); @@ -579,6 +592,14 @@ Ext.define('Rambox.view.main.MainController', { Ext.getCmp('tab_'+record.get('id')).setTitle(formValues.serviceName); // Change the icon of the Tab Ext.getCmp('tab_'+record.get('id')).setIcon(record.get('logo') === '' ? 'resources/icons/custom.png' : record.get('logo')); + // Change the align of the Tab + if ( oldData.align !== formValues.align ) { + if ( formValues.align === 'left' ) { + me.getView().moveBefore(Ext.getCmp('tab_'+record.get('id')), Ext.getCmp('tbfill')); + } else { + me.getView().moveAfter(Ext.getCmp('tab_'+record.get('id')), Ext.getCmp('tbfill')); + } + } } else { var service = Ext.create('Rambox.model.Service', { type: 'custom'