|
36 | 36 | :disabled="rightOnly && determineEditorType(currentSlide.panel[panelIndex]) === 'dynamic'"
|
37 | 37 | @change.stop="$vfm.open(`right-only-${slideIndex}`)"
|
38 | 38 | />
|
| 39 | + <span class="mx-2 font-bold">{{ $t('editor.slides.centerSlide') }}</span> |
| 40 | + <input |
| 41 | + type="checkbox" |
| 42 | + class="rounded-none cursor-pointer w-4 h-4" |
| 43 | + v-model="centerSlide" |
| 44 | + :disabled="centerPanel" |
| 45 | + @change.stop="toggleCenterSlide()" |
| 46 | + /> |
| 47 | + <span class="mx-2 font-bold">{{ $t('editor.slides.centerPanel') }}</span> |
| 48 | + <input |
| 49 | + type="checkbox" |
| 50 | + class="rounded-none cursor-pointer w-4 h-4" |
| 51 | + v-model="centerPanel" |
| 52 | + :disabled="centerSlide" |
| 53 | + @change.stop="toggleCenterPanel()" |
| 54 | + /> |
39 | 55 | </div>
|
40 | 56 | </div>
|
41 | 57 | </div>
|
|
215 | 231 | :lang="lang"
|
216 | 232 | :uid="uid"
|
217 | 233 | :sourceCounts="sourceCounts"
|
| 234 | + :centerSlide="centerSlide" |
| 235 | + :dynamicSelected="dynamicSelected" |
218 | 236 | @slide-edit="$emit('slide-edit')"
|
219 | 237 | ></component>
|
220 | 238 | </div>
|
|
229 | 247 | title: currentSlide.title
|
230 | 248 | })
|
231 | 249 | "
|
232 |
| - @ok="changePanelType(determineEditorType(currentSlide.panel[panelIndex]), newType)" |
| 250 | + @ok=" |
| 251 | + changePanelType(determineEditorType(currentSlide.panel[panelIndex]), newType); |
| 252 | + toggleCenterPanel(); |
| 253 | + toggleCenterSlide(); |
| 254 | + " |
233 | 255 | @Cancel="cancelTypeChange"
|
234 | 256 | />
|
235 | 257 | <confirmation-modal
|
@@ -302,6 +324,9 @@ export default class SlideEditorV extends Vue {
|
302 | 324 | panelIndex = 0;
|
303 | 325 | newType = '';
|
304 | 326 | rightOnly = false;
|
| 327 | + centerSlide = false; |
| 328 | + centerPanel = false; |
| 329 | + dynamicSelected = false; |
305 | 330 |
|
306 | 331 | editors: Record<string, string> = {
|
307 | 332 | text: 'text-editor',
|
@@ -373,6 +398,7 @@ export default class SlideEditorV extends Vue {
|
373 | 398 | if (newType === 'dynamic') {
|
374 | 399 | this.panelIndex = 0;
|
375 | 400 | this.currentSlide['panel'] = [startingConfig[newType as keyof DefaultConfigs]];
|
| 401 | + this.dynamicSelected = true; |
376 | 402 | } else {
|
377 | 403 | // Switching panel type when dynamic panels are not involved.
|
378 | 404 | this.currentSlide.panel[this.panelIndex] = startingConfig[newType as keyof DefaultConfigs];
|
@@ -503,6 +529,65 @@ export default class SlideEditorV extends Vue {
|
503 | 529 | ];
|
504 | 530 | }
|
505 | 531 | }
|
| 532 | +
|
| 533 | + toggleCenterSlide(): void { |
| 534 | + if (this.determineEditorType(this.currentSlide.panel[this.panelIndex]) === 'dynamic') { |
| 535 | + if (this.centerSlide) { |
| 536 | + this.currentSlide.panel[0].customStyles = 'text-align: right;'; |
| 537 | + } else { |
| 538 | + this.currentSlide.panel[0].customStyles = (this.currentSlide.panel[0].customStyles || '').replace( |
| 539 | + 'text-align: right;', |
| 540 | + '' |
| 541 | + ); |
| 542 | + } |
| 543 | + } else if (this.rightOnly) { |
| 544 | + if (this.centerSlide) { |
| 545 | + this.currentSlide.panel[0].customStyles = 'text-align: center;'; |
| 546 | + } else { |
| 547 | + this.currentSlide.panel[0].customStyles = (this.currentSlide.panel[0].customStyles || '').replace( |
| 548 | + 'text-align: right;', |
| 549 | + '' |
| 550 | + ); |
| 551 | + this.currentSlide.panel[0].customStyles = (this.currentSlide.panel[0].customStyles || '').replace( |
| 552 | + 'text-align: left;', |
| 553 | + '' |
| 554 | + ); |
| 555 | + this.currentSlide.panel[0].customStyles = (this.currentSlide.panel[0].customStyles || '').replace( |
| 556 | + 'text-align: center;', |
| 557 | + '' |
| 558 | + ); |
| 559 | + } |
| 560 | + } else { |
| 561 | + if (this.centerSlide) { |
| 562 | + this.currentSlide.panel[0].customStyles = 'text-align: right;'; |
| 563 | + this.currentSlide.panel[1].customStyles = 'text-align: left;'; |
| 564 | + } else { |
| 565 | + this.currentSlide.panel[0].customStyles = (this.currentSlide.panel[0].customStyles || '').replace( |
| 566 | + 'text-align: right;', |
| 567 | + '' |
| 568 | + ); |
| 569 | + this.currentSlide.panel[1].customStyles = (this.currentSlide.panel[1].customStyles || '').replace( |
| 570 | + 'text-align: left;', |
| 571 | + '' |
| 572 | + ); |
| 573 | + } |
| 574 | + } |
| 575 | + } |
| 576 | +
|
| 577 | + toggleCenterPanel(): void { |
| 578 | + if (this.centerPanel) { |
| 579 | + for (const p in this.currentSlide.panel) { |
| 580 | + this.currentSlide.panel[p].customStyles = 'text-align: center;'; |
| 581 | + } |
| 582 | + } else { |
| 583 | + for (const p in this.currentSlide.panel) { |
| 584 | + this.currentSlide.panel[p].customStyles = (this.currentSlide.panel[p].customStyles || '').replace( |
| 585 | + 'text-align: center;', |
| 586 | + '' |
| 587 | + ); |
| 588 | + } |
| 589 | + } |
| 590 | + } |
506 | 591 | }
|
507 | 592 | </script>
|
508 | 593 |
|
|
0 commit comments