From b506655333d6bc3cda479139d778af841e46ebf3 Mon Sep 17 00:00:00 2001 From: William Bout Date: Sat, 18 Feb 2017 18:33:54 -0800 Subject: [PATCH] Revert badge code Badge is not updated while switching documents --- app/js/preload.js | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/app/js/preload.js b/app/js/preload.js index dc931f5..c0a2587 100644 --- a/app/js/preload.js +++ b/app/js/preload.js @@ -1,5 +1,4 @@ const {SpellCheckHandler, ContextMenuListener, ContextMenuBuilder} = require('electron-spellchecker'); -const {remote } = require('electron'); window.spellCheckHandler = new SpellCheckHandler(); setTimeout(() => window.spellCheckHandler.attachToInput(), 1000); @@ -9,22 +8,3 @@ window.spellCheckHandler.autoUnloadDictionariesOnBlur(); window.contextMenuBuilder = new ContextMenuBuilder(window.spellCheckHandler, null, true); window.contextMenuListener = new ContextMenuListener((info) => { window.contextMenuBuilder.showPopupMenu(info); }); - -document.addEventListener('DOMContentLoaded', function(event) { - const notificationIndicator = document.querySelectorAll('.hp-notifications-badge')[0]; - - setTimeout(() => { - setBadge(notificationIndicator.textContent); - }, 200); - - notificationIndicator.addEventListener('DOMCharacterDataModified', (event) => { - setBadge(event.newValue); - }); - - function setBadge(newValue) { - if (newValue !== '0') - remote.app.dock.setBadge(newValue); - else - remote.app.dock.setBadge(''); - } -});