diff options
author | Alex Yatskov <alex@foosoft.net> | 2016-04-08 13:33:46 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2016-04-08 13:33:46 -0700 |
commit | ae3d8d27d90f3f206106d356d2a58a46eea62114 (patch) | |
tree | 05d45975e92a34f86fd3be215240b73c2df2a691 /ext/bg/js/options-form.js | |
parent | 26af561c12e746cfb2f3753114134e1d0362e4ee (diff) |
Options page improvements
Diffstat (limited to 'ext/bg/js/options-form.js')
-rw-r--r-- | ext/bg/js/options-form.js | 17 |
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))); |