Permalink
Browse files

Revert badge code

Badge is not updated while switching documents
  • Loading branch information...
1 parent fa9717c commit b506655333d6bc3cda479139d778af841e46ebf3 @williambout committed Feb 19, 2017
Showing with 0 additions and 20 deletions.
  1. +0 −20 app/js/preload.js
View
@@ -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('');
- }
-});

0 comments on commit b506655

Please sign in to comment.