From 5c6a1c8f78e0919f17fc9918693992c87c54b3e4 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Thu, 20 Jul 2017 14:56:06 +0100 Subject: [PATCH] Don't use animated favicon when kernel busy Addresses part of gh-2673 Each set of the favicon causes a new HTTP request. If we want an animated favicon, I think it's possible to use an animated GIF. But I find animated favicons annoying, so I'd rather just get rid of it entirely. Just because we can doesn't mean we should. ;-) --- notebook/static/notebook/js/notificationarea.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/notebook/static/notebook/js/notificationarea.js b/notebook/static/notebook/js/notificationarea.js index bc425d37b..bbcb46a5c 100644 --- a/notebook/static/notebook/js/notificationarea.js +++ b/notebook/static/notebook/js/notificationarea.js @@ -42,21 +42,12 @@ define([ var $modal_ind_icon = $("#modal_indicator"); var $readonly_ind_icon = $('#readonly-indicator'); var $body = $('body'); - var interval = 0; var set_busy_favicon = function(on) { - if (on && !interval) { - var i = 0; - var icons = ['favicon-busy-1.ico', 'favicon-busy-3.ico', 'favicon-busy-3.ico']; - interval = setInterval(function() { - var icon = icons[i % 3]; - utils.change_favicon('/static/base/images/' + icon); - i += 1; - }, 300); + if (on) { + utils.change_favicon('/static/base/images/favicon-busy-1.ico'); } else { - clearInterval(interval); utils.change_favicon('/static/base/images/favicon-notebook.ico'); - interval = 0; } };