diff --git a/js/components/multi_checkbox_input.js b/js/components/multi_checkbox_input.js index 7c0b822c..6ab3e050 100644 --- a/js/components/multi_checkbox_input.js +++ b/js/components/multi_checkbox_input.js @@ -1,4 +1,3 @@ -import otherinput from '../components/other_input' import optionsinput from '../components/options_input' import textinput from '../components/text_input' @@ -6,7 +5,6 @@ export default { name: 'multicheckboxinput', components: { - otherinput, optionsinput, textinput, }, @@ -29,17 +27,11 @@ export default { const showError = (this.initialErrors && this.initialErrors.length) || false return { showError: showError, - showValid: !showError && !!this.initialValue, + showValid: !showError && this.initialValue.length > 0, validationError: this.initialErrors.join(' '), otherChecked: this.initialValue.includes("other") ? true : this.otherChecked, otherText: this.initialOtherValue, - selections: [] - } - }, - - mounted: function () { - for (let choice of this.initialValue) { - this.selections.push(choice) + selections: this.initialValue } }, @@ -55,6 +47,6 @@ export default { otherToggle: function() { this.otherChecked = !this.otherChecked this.otherText = '' - } + }, } } diff --git a/js/components/other_input.js b/js/components/other_input.js deleted file mode 100644 index c2431b85..00000000 --- a/js/components/other_input.js +++ /dev/null @@ -1,29 +0,0 @@ -import FormMixin from '../mixins/form' -import textinput from '../components/text_input' - -export default { - name: 'otherinput', - - mixins: [FormMixin], - - components: { - textinput, - }, - - props: { - initialData: { - type: Array, - default: () => ({}) - } - }, - - data: function () { - const { - other = true - } = this.initialData - - return { - other - } - } -} diff --git a/js/index.js b/js/index.js index 39271984..5bbee5d1 100644 --- a/js/index.js +++ b/js/index.js @@ -7,7 +7,6 @@ import VTooltip from 'v-tooltip' import optionsinput from './components/options_input' import multicheckboxinput from './components/multi_checkbox_input' -import otherinput from './components/other_input' import textinput from './components/text_input' import checkboxinput from './components/checkbox_input' import DetailsOfUse from './components/forms/details_of_use' @@ -40,7 +39,6 @@ const app = new Vue({ toggler, optionsinput, multicheckboxinput, - otherinput, textinput, checkboxinput, DetailsOfUse, diff --git a/templates/components/multi_checkbox_input.html b/templates/components/multi_checkbox_input.html index 3bd294c5..ec8f666a 100644 --- a/templates/components/multi_checkbox_input.html +++ b/templates/components/multi_checkbox_input.html @@ -32,11 +32,11 @@ {% for choice in field.choices %}