aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/options-form.js17
1 files changed, 12 insertions, 5 deletions
diff --git a/ext/bg/js/options-form.js b/ext/bg/js/options-form.js
index 7504f74e..bc21793e 100644
--- a/ext/bg/js/options-form.js
+++ b/ext/bg/js/options-form.js
@@ -33,14 +33,21 @@ function formToOptions() {
$('#saveOptions').click(() => {
const opts = formToOptions();
- const yomichan = chrome.extension.getBackgroundPage().yomichan;
- saveOptions(opts, () => yomichan.updateOptions(opts));
+ saveOptions(opts, () => {
+ $('.notifyAlerts').hide();
+ $('#notifySave').slideDown();
+ chrome.extension.getBackgroundPage().yomichan.updateOptions(opts);
+ });
});
$('#resetOptions').click(() => {
- if (confirm('Reset options to default values?')) {
- optionsToForm(sanitizeOptions({}));
- }
+ optionsToForm(sanitizeOptions({}));
+ $('.notifyAlerts').hide();
+ $('#notifyReset').slideDown();
+});
+
+$('[data-hide]').on('click', function() {
+ $('#' + $(this).attr('data-hide')).hide();
});
$(document).ready(() => loadOptions((opts) => optionsToForm(opts)));