Skip to content

Commit 4f505d1

Browse files
authored
Merge pull request #340 from citation-file-format/321-disable-arrow-in-invalid-positions
2 parents c04a99a + a0aa436 commit 4f505d1

8 files changed

Lines changed: 40 additions & 0 deletions

src/components/AuthorCardEditing.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,15 @@
101101
<q-btn
102102
color="blue"
103103
dense
104+
v-bind:disable="index == 0"
104105
icon="ion-arrow-up"
105106
tabindex="-1"
106107
v-on:click="$emit('moveUp')"
107108
/>
108109
<q-btn
109110
color="blue"
110111
dense
112+
v-bind:disable="index >= numAuthors - 1"
111113
icon="ion-arrow-down"
112114
tabindex="-1"
113115
v-on:click="$emit('moveDown')"
@@ -167,6 +169,10 @@ export default defineComponent({
167169
email: {
168170
type: String,
169171
default: ''
172+
},
173+
numAuthors: {
174+
type: Number,
175+
default: 0
170176
}
171177
},
172178
setup () {

src/components/AuthorCardViewing.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
<q-btn
1717
class="author-button"
1818
color="blue"
19+
v-bind:disable="index == 0"
1920
icon="ion-arrow-up"
2021
tabindex="-1"
2122
v-on:click="$emit('moveUp')"
2223
/>
2324
<q-btn
2425
class="author-button"
2526
color="blue"
27+
v-bind:disable="index >= numAuthors - 1"
2628
icon="ion-arrow-down"
2729
tabindex="-1"
2830
v-on:click="$emit('moveDown')"
@@ -54,6 +56,10 @@ export default defineComponent({
5456
author: {
5557
type: Object as PropType<AuthorType>,
5658
required: true
59+
},
60+
numAuthors: {
61+
type: Number,
62+
default: 0
5763
}
5864
},
5965
emits: ['editPressed', 'moveDown', 'moveUp']

src/components/IdentifierCardEditing.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,15 @@
4949
<q-btn
5050
dense
5151
color="blue"
52+
v-bind:disable="index == 0"
5253
icon="ion-arrow-up"
5354
tabindex="-1"
5455
v-on:click="$emit('moveUp')"
5556
/>
5657
<q-btn
5758
dense
5859
color="blue"
60+
v-bind:disable="index >= numIdentifiers - 1"
5961
icon="ion-arrow-down"
6062
tabindex="-1"
6163
v-on:click="$emit('moveDown')"
@@ -100,6 +102,10 @@ export default defineComponent({
100102
description: {
101103
type: String,
102104
default: ''
105+
},
106+
numIdentifiers: {
107+
type: Number,
108+
default: 0
103109
}
104110
},
105111
setup (props) {

src/components/IdentifierCardViewing.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@
1515
<q-btn
1616
class="identifier-button"
1717
color="blue"
18+
v-bind:disable="index == 0"
1819
icon="ion-arrow-up"
1920
tabindex="-1"
2021
v-on:click="$emit('moveUp')"
2122
/>
2223
<q-btn
2324
class="identifier-button"
2425
color="blue"
26+
v-bind:disable="index >= numIdentifiers - 1"
2527
icon="ion-arrow-down"
2628
tabindex="-1"
2729
v-on:click="$emit('moveDown')"
@@ -53,6 +55,10 @@ export default defineComponent({
5355
identifier: {
5456
type: Object as PropType<IdentifierType>,
5557
required: true
58+
},
59+
numIdentifiers: {
60+
type: Number,
61+
default: 0
5662
}
5763
},
5864
emits: ['editPressed', 'moveDown', 'moveUp']

src/components/Keyword.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
<q-btn
1515
class="keyword-btn"
1616
color="blue"
17+
v-bind:disable="index == 0"
1718
icon="ion-arrow-up"
1819
tabindex="-1"
1920
v-on:click="$emit('moveUp')"
2021
/>
2122
<q-btn
2223
class="keyword-btn"
2324
color="blue"
25+
v-bind:disable="index == numKeywords - 1"
2426
icon="ion-arrow-down"
2527
tabindex="-1"
2628
v-on:click="$emit('moveDown')"
@@ -47,6 +49,14 @@ export default defineComponent({
4749
keyword: {
4850
type: String,
4951
default: ''
52+
},
53+
index: {
54+
type: Number,
55+
required: true
56+
},
57+
numKeywords: {
58+
type: Number,
59+
default: 0
5060
}
5161
},
5262
setup () {

src/components/ScreenAuthors.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@
2222
v-if="editingId !== index"
2323
v-bind:index="index"
2424
v-bind:author="author"
25+
v-bind:num-authors="authors.length"
2526
v-on:editPressed="() => (editingId = index)"
2627
v-on:moveDown="moveAuthorDown(index)"
2728
v-on:moveUp="moveAuthorUp(index)"
2829
/>
2930
<AuthorCardEditing
3031
v-else
3132
v-bind:index="index"
33+
v-bind:num-authors="authors.length"
3234
v-bind="author"
3335
v-on:update="setAuthorField"
3436
v-on:closePressed="() => (editingId = -1)"

src/components/ScreenIdentifiers.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
v-if="editingId !== index"
3333
v-bind:index="index"
3434
v-bind:identifier="identifier"
35+
v-bind:num-identifiers="identifiers.length"
3536
v-on:editPressed="() => (editingId = index)"
3637
v-on:moveDown="moveIdentifierDown(index)"
3738
v-on:moveUp="moveIdentifierUp(index)"
@@ -40,6 +41,7 @@
4041
v-else
4142
v-bind:index="index"
4243
v-bind="identifier"
44+
v-bind:num-identifiers="identifiers.length"
4345
v-on:updateType="setIdentifierTypeField"
4446
v-on:updateValue="setIdentifierValueField"
4547
v-on:updateDescription="setIdentifierDescriptionField"

src/components/ScreenKeywords.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
class="q-mr-lg"
2121
v-bind:key="index"
2222
v-bind:keyword="keyword"
23+
v-bind:index="index"
24+
v-bind:num-keywords="keywords.length"
2325
v-for="(keyword, index) in keywords"
2426
v-on:moveDown="moveDown(index, keywords, setKeywords)"
2527
v-on:moveUp="moveUp(index, keywords, setKeywords)"

0 commit comments

Comments
 (0)