Skip to content

Commit 830cc3d

Browse files
authored
Merge pull request #13 from davoreric/mass-action-with-one-option
2 parents eb1d1af + 4298088 commit 830cc3d

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

src/js/components/massActions.vue

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
@submit.prevent="runSelectedAction"
55
:class="{
66
activeDropdown: selectedModelsOpened,
7-
withSelection: selectedModels.length
7+
withSelection: selectedModels.length,
8+
singleAction: hasSingleAction
89
}"
910
v-on-dismiss="{
1011
callback: closeSelectedModels,
@@ -92,9 +93,15 @@ export default {
9293
9394
},
9495
96+
hasSingleAction() {
97+
98+
return this.actions.length === 1;
99+
100+
},
101+
95102
submitButtonCaption() {
96103
97-
return this.currentAction.buttonCaption || this.translations.submitButtonCaption;
104+
return this.currentAction.buttonCaption || this.hasSingleAction ? this.currentAction.caption : this.translations.submitButtonCaption;
98105
99106
}
100107
},
@@ -403,6 +410,20 @@ export default {
403410
404411
}
405412
413+
&.singleAction {
414+
415+
.selectCont {
416+
display: none;
417+
}
418+
419+
> .submitBtn {
420+
421+
border-radius: em(4,13);
422+
423+
}
424+
425+
}
426+
406427
.select > button > .count {
407428
408429
display: none;

0 commit comments

Comments
 (0)