summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-05-07 10:43:54 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-05-07 10:43:54 +0200
commit030f3e2ccd02a2786bba701d4b82cd2076de8133 (patch)
treed54e61353b72dcb81256d81e4ae50e93831f8363 /js
parent1fca21d6d47eb38a0ba2e25e0cf51967c1873573 (diff)
dont highlight tab title when nothing changed, fix #157
Diffstat (limited to 'js')
-rw-r--r--js/app/controllers/feedcontroller.coffee11
-rw-r--r--js/public/app.js9
2 files changed, 14 insertions, 6 deletions
diff --git a/js/app/controllers/feedcontroller.coffee b/js/app/controllers/feedcontroller.coffee
index 41e4fa07d..43488ddba 100644
--- a/js/app/controllers/feedcontroller.coffee
+++ b/js/app/controllers/feedcontroller.coffee
@@ -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 = =>
diff --git a/js/public/app.js b/js/public/app.js
index ced24417e..91a50de34 100644
--- a/js/public/app.js
+++ b/js/public/app.js
@@ -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;
};