dont highlight tab title when nothing changed, fix #157

This commit is contained in:
Bernhard Posselt 2013-05-07 10:43:54 +02:00
Родитель 1fca21d6d4
Коммит 030f3e2ccd
2 изменённых файлов: 14 добавлений и 6 удалений

Просмотреть файл

@ -56,10 +56,15 @@ ActiveFeed, FeedType, $window) ->
# and it has nothing to do with the body structure
if count > 0
titleCount = @_unreadCountFormatter(count)
@_$window.document.title =
'News (' + titleCount + ') | ownCloud'
title = 'News (' + titleCount + ') | ownCloud'
else
@_$window.document.title = 'News | ownCloud'
title = 'News | ownCloud'
# only update title when it changed to prevent highlighting the
# tab
if @_$window.document.title != title
@_$window.document.title = title
return count
@_$scope.isAddingFolder = =>

Просмотреть файл

@ -436,14 +436,17 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
this._$scope.starredBusinessLayer = this._starredBusinessLayer;
this._$scope.unreadCountFormatter = this._unreadCountFormatter;
this._$scope.getTotalUnreadCount = function() {
var count, titleCount;
var count, title, titleCount;
count = _this._subscriptionsBusinessLayer.getUnreadCount(0);
if (count > 0) {
titleCount = _this._unreadCountFormatter(count);
_this._$window.document.title = 'News (' + titleCount + ') | ownCloud';
title = 'News (' + titleCount + ') | ownCloud';
} else {
_this._$window.document.title = 'News | ownCloud';
title = 'News | ownCloud';
}
if (_this._$window.document.title !== title) {
_this._$window.document.title = title;
}
return count;
};