Browse Source

Fixed active service name in title

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

8
app/Application.js

@ -282,11 +282,19 @@ Ext.define('Rambox.Application', {
,updateTotalNotifications: function( newValue, oldValue ) {
newValue = parseInt(newValue);
if ( newValue > 0 ) {
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 {
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';
}
}
}
,checkUpdate: function(silence) {
console.info('Checking for updates...');

10
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' ) {
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) {

Loading…
Cancel
Save