summaryrefslogtreecommitdiff
path: root/ext/bg/js/popup.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-03-25 18:19:38 -0700
committerAlex Yatskov <alex@foosoft.net>2017-03-25 18:19:38 -0700
commit37321e8d52849b0824132e2339760e96308abbb6 (patch)
tree1e6b986768e65d07337bc31ae1d8c2641f60d9f4 /ext/bg/js/popup.js
parent2c164fb65f286e2852c7e5eb5e7098c5a4fe6f1a (diff)
parent063f3d4dbf8c896f4f7b022cfae6e2b907769251 (diff)
Merge branch 'dev'
Diffstat (limited to 'ext/bg/js/popup.js')
-rw-r--r--ext/bg/js/popup.js11
1 files changed, 4 insertions, 7 deletions
diff --git a/ext/bg/js/popup.js b/ext/bg/js/popup.js
index 9f2567df..8577dd96 100644
--- a/ext/bg/js/popup.js
+++ b/ext/bg/js/popup.js
@@ -18,17 +18,14 @@
$(document).ready(() => {
- $('#open-search').click(() => window.open(chrome.extension.getURL('/bg/search.html')));
- $('#open-options').click(() => chrome.runtime.openOptionsPage());
- $('#open-help').click(() => window.open('http://foosoft.net/projects/yomichan'));
+ $('#open-search').click(() => commandExec('search'));
+ $('#open-options').click(() => commandExec('options'));
+ $('#open-help').click(() => commandExec('help'));
optionsLoad().then(options => {
const toggle = $('#enable-search');
toggle.prop('checked', options.general.enable).change();
toggle.bootstrapToggle();
- toggle.change(() => {
- options.general.enable = toggle.prop('checked');
- optionsSave(options).then(() => instYomi().optionsSet(options));
- });
+ toggle.change(() => commandExec('toggle'));
});
});