avoid empty names with required

Signed-off-by: Jakob <jakob.roehrl@web.de>
This commit is contained in:
Jakob
2019-08-29 08:39:52 +02:00
parent 1c040d35be
commit 619f70b33b
2 changed files with 4 additions and 22 deletions

View File

@@ -76,8 +76,7 @@ export default {
return {
newStackTitle: '',
stack: '',
showArchived: false,
missingStackName: t('deck', 'stack title must be provided')
showArchived: false
}
},
computed: {
@@ -90,13 +89,6 @@ export default {
return 'opacity: 1.0'
}
return 'opacity: 0.3'
},
addNewStackValidation() {
if (this.newStackTitle === '') {
return false
}
return true
}
},
methods: {

View File

@@ -48,11 +48,9 @@
<label for="new-stack-input-main" class="hidden-visually">Add a new card</label>
<input id="new-stack-input-main" v-model="newCardTitle" type="text"
class="no-close"
placeholder="Add a new card">
placeholder="Add a new card" required>
<input v-tooltip="{content: missingCardName, show: !addNewCardValidation, trigger: 'manual' }"
:disabled="!addNewCardValidation"
class="icon-confirm"
<input class="icon-confirm"
type="submit"
value="">
</form>
@@ -87,20 +85,12 @@ export default {
return {
editing: false,
copiedStack: '',
newCardTitle: '',
missingCardName: t('deck', 'card title must be provided')
newCardTitle: ''
}
},
computed: {
cardsByStack() {
return (id) => this.$store.getters.cardsByStack(id)
},
addNewCardValidation() {
if (this.newCardTitle === '') {
return false
}
return true
}
},