From 27b93202cbc98683afe7b13e118e3bd75c01f792 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jul 28 2015 14:30:44 +0000 Subject: Do not blink the title if the window is in focus already This has two implications: - We won't have the blink when we comment on the page - We won't have the blink when someone else comments on the page --- diff --git a/pagure/static/issue_ev.js b/pagure/static/issue_ev.js index 2c11139..cce79f3 100644 --- a/pagure/static/issue_ev.js +++ b/pagure/static/issue_ev.js @@ -236,7 +236,7 @@ process_event = function( category = 'Issue edited'; } - if (category) { + if (category && !document.hasFocus()) { var int = setInterval(function(){ var title = document.title; document.title = (title === originalTitle) ? category : originalTitle; diff --git a/pagure/static/request_ev.js b/pagure/static/request_ev.js index 24b3f9f..be4d85f 100644 --- a/pagure/static/request_ev.js +++ b/pagure/static/request_ev.js @@ -51,7 +51,7 @@ process_event = function(data, requestid){ category = 'comment'; } - if (category) { + if (category && !document.hasFocus()) { var int = setInterval(function(){ var title = document.title; document.title = (title === originalTitle) ? category : originalTitle;