Browse Source

Minor stylefixes

master
Igor Zhukov 10 years ago
parent
commit
51b8e7b93a
  1. 1
      app/css/app.css
  2. 21
      app/js/services.js

1
app/css/app.css

@ -10,6 +10,7 @@ body {
background: none; background: none;
font: 12px/18px 'Open Sans', "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, Verdana, sans-serif; font: 12px/18px 'Open Sans', "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, Verdana, sans-serif;
overflow: visible; overflow: visible;
overflow-x: hidden;
} }
body.non_osx { body.non_osx {
font: 13px/18px Tahoma, sans-serif, Arial, Helvetica; font: 13px/18px Tahoma, sans-serif, Arial, Helvetica;

21
app/js/services.js

@ -3599,8 +3599,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
var nextSoundAt = false; var nextSoundAt = false;
var prevSoundVolume = false; var prevSoundVolume = false;
var peerSettings = {}; var peerSettings = {};
var faviconBackupEl = $('link[rel="icon"]:first'), var faviconEl = $('link[rel="icon"]:first')[0];
faviconNewEl = $('<link rel="icon" href="favicon_unread.ico" type="image/x-icon" />');
var langNotificationsPluralize = _.pluralize('page_title_pluralize_notifications'); var langNotificationsPluralize = _.pluralize('page_title_pluralize_notifications');
var titleBackup = document.title, var titleBackup = document.title,
@ -3614,7 +3613,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
$interval.cancel(titlePromise); $interval.cancel(titlePromise);
if (!newVal) { if (!newVal) {
document.title = titleBackup; document.title = titleBackup;
$('link[rel="icon"]:first').replaceWith(faviconBackupEl); setFavicon();
} else { } else {
titleBackup = document.title; titleBackup = document.title;
@ -3622,13 +3621,10 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
var time = tsNow(); var time = tsNow();
if (!notificationsCount || time % 2000 > 1000) { if (!notificationsCount || time % 2000 > 1000) {
document.title = titleBackup; document.title = titleBackup;
var curFav = $('link[rel="icon"]:first'); setFavicon();
if (curFav.attr('href').indexOf('favicon_unread') != -1) {
curFav.replaceWith(faviconBackupEl);
}
} else { } else {
document.title = langNotificationsPluralize(notificationsCount); document.title = langNotificationsPluralize(notificationsCount);
$('link[rel="icon"]:first').replaceWith(faviconNewEl); setFavicon('favicon_unread.ico');
} }
}, 1000); }, 1000);
} }
@ -3687,6 +3683,15 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
}); });
} }
function setFavicon (href) {
var link = document.createElement('link');
link.rel = 'shortcut icon';
link.type = 'image/x-icon';
link.href = href || 'favicon.ico';
faviconEl.parentNode.replaceChild(link, faviconEl);
faviconEl = link;
}
function savePeerSettings (peerID, settings) { function savePeerSettings (peerID, settings) {
// console.trace(dT(), 'peer settings', peerID, settings); // console.trace(dT(), 'peer settings', peerID, settings);
peerSettings[peerID] = $q.when(settings); peerSettings[peerID] = $q.when(settings);

Loading…
Cancel
Save