diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-11-25 15:08:41 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-11-26 11:45:05 +0900 |
commit | 507000619377f82ca63251c8c5db98af690a5ed2 (patch) | |
tree | a08a8b6b8dca715d22f35b69b6b20c2b0ec0499c /src/settings/components/form | |
parent | df10208ed5dfbc823eb1979272903d74f02a898c (diff) |
add button
Diffstat (limited to 'src/settings/components/form')
-rw-r--r-- | src/settings/components/form/blacklist-form.jsx | 4 | ||||
-rw-r--r-- | src/settings/components/form/search-engine-form.jsx | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/settings/components/form/blacklist-form.jsx b/src/settings/components/form/blacklist-form.jsx index 83b54da..9cb547b 100644 --- a/src/settings/components/form/blacklist-form.jsx +++ b/src/settings/components/form/blacklist-form.jsx @@ -1,4 +1,5 @@ import './blacklist-form.scss'; +import AddButton from '../ui/add-button'; import DeleteButton from '../ui/delete-button'; import { h, Component } from 'preact'; @@ -22,6 +23,7 @@ class BlacklistForm extends Component { </div>; }) } + <AddButton name='add' onClick={this.bindValue.bind(this)} /> </div>; } @@ -36,6 +38,8 @@ class BlacklistForm extends Component { if (name === 'url') { next[index] = e.target.value; + } else if (name === 'add') { + next.push(''); } else if (name === 'delete') { next.splice(index, 1); } diff --git a/src/settings/components/form/search-engine-form.jsx b/src/settings/components/form/search-engine-form.jsx index c86522a..faa066f 100644 --- a/src/settings/components/form/search-engine-form.jsx +++ b/src/settings/components/form/search-engine-form.jsx @@ -1,5 +1,6 @@ import './search-engine-form.scss'; import { h, Component } from 'preact'; +import AddButton from '../ui/add-button'; import DeleteButton from '../ui/delete-button'; class SearchEngineForm extends Component { @@ -40,6 +41,7 @@ class SearchEngineForm extends Component { </div>; }) } + <AddButton name='add' onClick={this.bindValue.bind(this)} /> </div>; } @@ -58,6 +60,8 @@ class SearchEngineForm extends Component { next.engines[index][1] = e.target.value; } else if (name === 'default') { next.default = this.props.value.engines[index][0]; + } else if (name === 'add') { + next.engines.push(['', '']); } else if (name === 'delete') { next.engines.splice(index, 1); } |