From a23e862e62ae47c290c972b295f805b03a3ffc6c Mon Sep 17 00:00:00 2001 From: lilia Date: Thu, 3 Dec 2015 17:13:38 -0800 Subject: [PATCH] Clear dock/taskbar attention on window focus Fixes #440 // FREEBIE --- js/chromium.js | 7 +++++++ js/panel_controller.js | 1 + 2 files changed, 8 insertions(+) diff --git a/js/chromium.js b/js/chromium.js index ffa390f7d..42384e406 100644 --- a/js/chromium.js +++ b/js/chromium.js @@ -137,6 +137,13 @@ w.clearAttention(); w.drawAttention(); } + }, + + clearAttention: function(window_id) { + if (chrome.app.window) { + var w = chrome.app.window.get(window_id); + w.clearAttention(); + } } }; diff --git a/js/panel_controller.js b/js/panel_controller.js index 53d9a3db4..db014378e 100644 --- a/js/panel_controller.js +++ b/js/panel_controller.js @@ -57,6 +57,7 @@ }); appWindow.contentWindow.addEventListener('focus', function() { inboxFocused = true; + extension.windows.clearAttention(inboxWindowId); }); // close the inbox if background.html is refreshed