diff --git a/options/index.js b/options/index.js index 5d262acd..604c3211 100644 --- a/options/index.js +++ b/options/index.js @@ -4,7 +4,7 @@ function restore () { chrome.runtime.getBackgroundPage(bg => { document.getElementById('badgeDisabled').value = bg.prefs.get('badgeDisabled'); document.getElementById('badgeNormal').value = bg.prefs.get('badgeNormal'); - document.getElementById('popupWidth').value = bg.prefs.get('popupWidth'); + document.getElementById('popupWidth').value = localStorage.getItem('popupWidth') || '246'; document.getElementById('updateInterval').value = bg.prefs.get('updateInterval'); }); } @@ -13,7 +13,7 @@ function save () { chrome.runtime.getBackgroundPage(bg => { bg.prefs.set('badgeDisabled', document.getElementById('badgeDisabled').value); bg.prefs.set('badgeNormal', document.getElementById('badgeNormal').value); - bg.prefs.set('popupWidth', +document.getElementById('popupWidth').value); + localStorage.setItem('popupWidth', document.getElementById('popupWidth').value); bg.prefs.set( 'updateInterval', Math.max(0, +document.getElementById('updateInterval').value) diff --git a/popup.css b/popup.css index dd5c9f19..c69033d0 100644 --- a/popup.css +++ b/popup.css @@ -1,5 +1,5 @@ body { - width: 240px; + width: 252px; font-size: 12px; font-family: Arial,"Helvetica Neue",Helvetica,sans-serif; } diff --git a/popup.js b/popup.js index 510e49c3..9a3a9c17 100644 --- a/popup.js +++ b/popup.js @@ -229,4 +229,4 @@ document.querySelector('#popup-shortcuts-button').addEventListener("click", func }); // popup width -document.body.style.width = prefs.get('popupWidth') + 'px'; +document.body.style.width = (localStorage.getItem('popupWidth') || '246') + 'px';