From 52b5eeebb52a08a8f340cf50f2324982b4d26f54 Mon Sep 17 00:00:00 2001 From: blackstormx Date: Wed, 29 Jul 2020 16:19:17 +0400 Subject: [PATCH] fixes --- background.js | 18 ++++++++++++++---- popup.html | 1 + 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/background.js b/background.js index 4ed16c9..594d83b 100644 --- a/background.js +++ b/background.js @@ -29,10 +29,13 @@ chrome.storage.sync.get("customBanWord", function(items) { }); set.onclick = () => { - chrome.storage.sync.set({ customBanWord: customBanWord.value }, function() { - customBanWord.placeholder = "Current: " + customBanWord.value; - customBanWord.value = ""; - }); + saveNewBanWord(); +}; + +customBanWord.onkeyup = e => { + if (e.keyCode == 13) { + saveNewBanWord(); + } }; customSloganTextbox.onkeyup = e => { @@ -47,6 +50,13 @@ addSlogan.onclick = () => { addNew(); }; +function saveNewBanWord() { + chrome.storage.sync.set({ customBanWord: customBanWord.value }, function() { + customBanWord.placeholder = "Current: " + customBanWord.value; + customBanWord.value = ""; + }); +} + function addNew() { const customSlogan = customSloganTextbox.value.toLowerCase(); if (!customSlogans.includes(customSlogan)) { diff --git a/popup.html b/popup.html index 8526cf3..d039217 100644 --- a/popup.html +++ b/popup.html @@ -41,6 +41,7 @@ } #page1 > .list { height: calc(100% - 80px); + max-height: 340px; } #page2 > .list { height: calc(100% - 220px);