Browse Source

Fixed active service name in title

pull/1121/head
Ramiro Saenz 8 years ago
parent
commit
ef8354ac43
  1. 12
      app/Application.js
  2. 12
      app/view/main/MainController.js

12
app/Application.js

@ -282,9 +282,17 @@ Ext.define('Rambox.Application', {
,updateTotalNotifications: function( newValue, oldValue ) { ,updateTotalNotifications: function( newValue, oldValue ) {
newValue = parseInt(newValue); newValue = parseInt(newValue);
if ( newValue > 0 ) { 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 { } 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';
}
} }
} }

12
app/view/main/MainController.js

@ -11,7 +11,11 @@ Ext.define('Rambox.view.main.MainController', {
ga_storage._trackPageview('/index.html', 'main'); ga_storage._trackPageview('/index.html', 'main');
if ( newTab.id === 'ramboxTab' ) { if ( newTab.id === 'ramboxTab' ) {
document.title = 'Rambox'; if ( Rambox.app.getTotalNotifications() > 0 ) {
document.title = 'Rambox ('+ Rambox.app.getTotalNotifications() +')';
} else {
document.title = 'Rambox';
}
return; return;
} }
@ -23,7 +27,11 @@ Ext.define('Rambox.view.main.MainController', {
if ( webview ) webview.focus(); if ( webview ) webview.focus();
// Update the main window so it includes the active tab title. // 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) { ,updatePositions: function(tabPanel, tab) {

Loading…
Cancel
Save