moving popupWidth pref to localStorage base on https://github.com/schomery/stylish-chrome/issues/38#issuecomment-284693730
This commit is contained in:
parent
974aaee823
commit
885bab9a03
|
@ -4,7 +4,7 @@ function restore () {
|
||||||
chrome.runtime.getBackgroundPage(bg => {
|
chrome.runtime.getBackgroundPage(bg => {
|
||||||
document.getElementById('badgeDisabled').value = bg.prefs.get('badgeDisabled');
|
document.getElementById('badgeDisabled').value = bg.prefs.get('badgeDisabled');
|
||||||
document.getElementById('badgeNormal').value = bg.prefs.get('badgeNormal');
|
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');
|
document.getElementById('updateInterval').value = bg.prefs.get('updateInterval');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ function save () {
|
||||||
chrome.runtime.getBackgroundPage(bg => {
|
chrome.runtime.getBackgroundPage(bg => {
|
||||||
bg.prefs.set('badgeDisabled', document.getElementById('badgeDisabled').value);
|
bg.prefs.set('badgeDisabled', document.getElementById('badgeDisabled').value);
|
||||||
bg.prefs.set('badgeNormal', document.getElementById('badgeNormal').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(
|
bg.prefs.set(
|
||||||
'updateInterval',
|
'updateInterval',
|
||||||
Math.max(0, +document.getElementById('updateInterval').value)
|
Math.max(0, +document.getElementById('updateInterval').value)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
body {
|
body {
|
||||||
width: 240px;
|
width: 252px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-family: Arial,"Helvetica Neue",Helvetica,sans-serif;
|
font-family: Arial,"Helvetica Neue",Helvetica,sans-serif;
|
||||||
}
|
}
|
||||||
|
|
2
popup.js
2
popup.js
|
@ -229,4 +229,4 @@ document.querySelector('#popup-shortcuts-button').addEventListener("click", func
|
||||||
});
|
});
|
||||||
|
|
||||||
// popup width
|
// popup width
|
||||||
document.body.style.width = prefs.get('popupWidth') + 'px';
|
document.body.style.width = (localStorage.getItem('popupWidth') || '246') + 'px';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user