|
19 | 19 | <b-col cols="2"> |
20 | 20 | <b-button-group v-if="IS_SCRIPT_EDITOR"> |
21 | 21 | <template v-if="!IS_CURRENT_EDITOR && !IS_CURRENT_CUTTER"> |
22 | | - <b-button variant="warning" :disabled="!CAN_REQUEST_EDIT" @click="requestEdit"> |
23 | | - Edit |
24 | | - </b-button> |
25 | | - <b-button variant="warning" :disabled="!CAN_REQUEST_CUTS" @click="requestCutEdit"> |
26 | | - Cuts |
27 | | - </b-button> |
| 22 | + <span v-b-tooltip.hover="editDisabledReason" class="btn-group-item"> |
| 23 | + <b-button variant="warning" :disabled="!CAN_REQUEST_EDIT" @click="requestEdit"> |
| 24 | + Edit |
| 25 | + </b-button> |
| 26 | + </span> |
| 27 | + <span v-b-tooltip.hover="cutsDisabledReason" class="btn-group-item"> |
| 28 | + <b-button variant="warning" :disabled="!CAN_REQUEST_CUTS" @click="requestCutEdit"> |
| 29 | + Cuts |
| 30 | + </b-button> |
| 31 | + </span> |
28 | 32 | </template> |
29 | 33 | <template v-if="IS_CURRENT_EDITOR"> |
30 | 34 | <b-button |
@@ -291,6 +295,16 @@ export default { |
291 | 295 | } |
292 | 296 | return 'primary'; |
293 | 297 | }, |
| 298 | + editDisabledReason() { |
| 299 | + if (this.CUTTERS.length > 0) return 'Another user is currently making cuts'; |
| 300 | + return ''; |
| 301 | + }, |
| 302 | + cutsDisabledReason() { |
| 303 | + if (this.EDITORS.length > 0) return 'Another user is currently editing'; |
| 304 | + if (this.CUTTERS.length > 0) return 'Another user is currently making cuts'; |
| 305 | + if (this.HAS_DRAFT) return 'An unsaved draft exists'; |
| 306 | + return ''; |
| 307 | + }, |
294 | 308 | canEdit() { |
295 | 309 | return this.IS_CURRENT_EDITOR; |
296 | 310 | }, |
@@ -1145,4 +1159,18 @@ export default { |
1145 | 1159 | border-bottom: 1px solid #dee2e6; |
1146 | 1160 | background: var(--body-background); |
1147 | 1161 | } |
| 1162 | +
|
| 1163 | +.btn-group-item { |
| 1164 | + display: flex; |
| 1165 | +} |
| 1166 | +
|
| 1167 | +.btn-group-item:first-child > .btn { |
| 1168 | + border-top-right-radius: 0; |
| 1169 | + border-bottom-right-radius: 0; |
| 1170 | +} |
| 1171 | +
|
| 1172 | +.btn-group-item:last-child > .btn { |
| 1173 | + border-top-left-radius: 0; |
| 1174 | + border-bottom-left-radius: 0; |
| 1175 | +} |
1148 | 1176 | </style> |
0 commit comments