From 507000619377f82ca63251c8c5db98af690a5ed2 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sat, 25 Nov 2017 15:08:41 +0900 Subject: add button --- src/settings/components/form/blacklist-form.jsx | 4 ++++ src/settings/components/form/search-engine-form.jsx | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'src/settings/components/form') 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 { ; }) } + ; } @@ -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 { ; }) } + ; } @@ -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); } -- cgit v1.2.3