Skip to content

Commit

Permalink
fix: Save customCSS on preset click (closes #84)
Browse files Browse the repository at this point in the history
  • Loading branch information
plibither8 committed Apr 20, 2021
1 parent 34a3f43 commit f2372e8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import fitTextarea from "fit-textarea";
import OptionsSync from "webext-options-sync";
import indentTextarea from "indent-textarea";

const optionsStorage = new OptionsSync({ logging: false });

fitTextarea.watch("textarea");
indentTextarea.watch("textarea");

Expand Down Expand Up @@ -59,8 +61,9 @@ for (const link of presetLinks) {
customCssTextarea.value +=
`\n\n/* Preset: ${preset} */` + trim(cssPresets[link.dataset.preset]);
customCssTextarea.value = customCssTextarea.value.trim();
optionsStorage.set({ customCSS: customCssTextarea.value });
});
}

// Watch and sync the form
new OptionsSync({ logging: false }).syncForm("#options-form");
optionsStorage.syncForm("#options-form");

0 comments on commit f2372e8

Please sign in to comment.