prefs: saved only the changed pref. #14
This commit is contained in:
parent
f2e4db183c
commit
8d4f3b564a
2 changed files with 5 additions and 3 deletions
|
|
@ -7,7 +7,8 @@
|
||||||
<body>
|
<body>
|
||||||
<div id="miczRelNotes"><a href="mzta-release-notes.html">Release Notes</a></div>
|
<div id="miczRelNotes"><a href="mzta-release-notes.html">Release Notes</a></div>
|
||||||
<div id="miczPrefs"><label><input type="checkbox" id="force_msedge" name="force_msedge" class="option-input" /> __MSG_forceMsedgeOptionText__</label><br/>
|
<div id="miczPrefs"><label><input type="checkbox" id="force_msedge" name="force_msedge" class="option-input" /> __MSG_forceMsedgeOptionText__</label><br/>
|
||||||
<input type="checkbox" id="always_link" name="always_link" class="option-input" /> __MSG_AlwaysLinkOptionText__</label></div>
|
<label><input type="checkbox" id="always_link" name="always_link" class="option-input" /> __MSG_AlwaysLinkOptionText__</label><br/>
|
||||||
|
<label><input type="text" id="default_sign_name" name="default_sign_name" class="option-input" /> Default signature name</label></div>
|
||||||
<div id="miczDescription">
|
<div id="miczDescription">
|
||||||
<h1>__MSG_prefsInfoTitle__</h1>
|
<h1>__MSG_prefsInfoTitle__</h1>
|
||||||
<p>__MSG_prefsInfoDesc_1__<br/>
|
<p>__MSG_prefsInfoDesc_1__<br/>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
function saveOptions(e) {
|
function saveOptions(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
let options = {};
|
let options = {};
|
||||||
document.querySelectorAll(".option-input").forEach(element => {
|
let element = e.target;
|
||||||
|
|
||||||
switch (element.type) {
|
switch (element.type) {
|
||||||
case 'checkbox':
|
case 'checkbox':
|
||||||
options[element.id] = element.checked;
|
options[element.id] = element.checked;
|
||||||
|
|
@ -19,7 +20,7 @@ function saveOptions(e) {
|
||||||
console.log('Unhandled input type:', element.type);
|
console.log('Unhandled input type:', element.type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
browser.storage.sync.set(options);
|
browser.storage.sync.set(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue