From ef8354ac43c990011cd34766036bb111b4dfc4ae Mon Sep 17 00:00:00 2001 From: Ramiro Saenz Date: Tue, 5 Sep 2017 12:59:45 -0300 Subject: [PATCH] Fixed active service name in title --- app/Application.js | 12 ++++++++++-- app/view/main/MainController.js | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/app/Application.js b/app/Application.js index 525758b7..cd9ababf 100644 --- a/app/Application.js +++ b/app/Application.js @@ -282,9 +282,17 @@ Ext.define('Rambox.Application', { ,updateTotalNotifications: function( newValue, oldValue ) { newValue = parseInt(newValue); if ( newValue > 0 ) { - document.title = 'Rambox (' + Rambox.util.Format.formatNumber(newValue) + ')'; + if ( Ext.cq1('app-main').getActiveTab().record ) { + document.title = 'Rambox (' + Rambox.util.Format.formatNumber(newValue) + ') - '+Ext.cq1('app-main').getActiveTab().record.get('name'); + } else { + document.title = 'Rambox (' + Rambox.util.Format.formatNumber(newValue) + ')'; + } } else { - document.title = 'Rambox'; + if ( Ext.cq1('app-main') && Ext.cq1('app-main').getActiveTab().record ) { + document.title = 'Rambox - '+Ext.cq1('app-main').getActiveTab().record.get('name'); + } else { + document.title = 'Rambox'; + } } } diff --git a/app/view/main/MainController.js b/app/view/main/MainController.js index bd7bea09..ab93b03d 100644 --- a/app/view/main/MainController.js +++ b/app/view/main/MainController.js @@ -11,7 +11,11 @@ Ext.define('Rambox.view.main.MainController', { ga_storage._trackPageview('/index.html', 'main'); if ( newTab.id === 'ramboxTab' ) { - document.title = 'Rambox'; + if ( Rambox.app.getTotalNotifications() > 0 ) { + document.title = 'Rambox ('+ Rambox.app.getTotalNotifications() +')'; + } else { + document.title = 'Rambox'; + } return; } @@ -23,7 +27,11 @@ Ext.define('Rambox.view.main.MainController', { if ( webview ) webview.focus(); // Update the main window so it includes the active tab title. - document.title = 'Rambox - ' + newTab.title; + if ( Rambox.app.getTotalNotifications() > 0 ) { + document.title = 'Rambox ('+ Rambox.app.getTotalNotifications() +') - ' + newTab.record.get('name'); + } else { + document.title = 'Rambox - ' + newTab.record.get('name'); + } } ,updatePositions: function(tabPanel, tab) {