зеркало из https://github.com/nextcloud/news.git
dont highlight tab title when nothing changed, fix #157
This commit is contained in:
Родитель
1fca21d6d4
Коммит
030f3e2ccd
|
@ -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;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче