Skip to content

Commit 5fdc0a5

Browse files
author
Ryan Coulson
committed
dynamic panel editor enhancements
1 parent a6f7431 commit 5fdc0a5

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/components/dynamic-editor.vue

+15-3
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,14 @@
3939
<td>{{ determineEditorType(item.panel) }}</td>
4040
<td>
4141
<span @click="() => switchSlide(idx)">{{ $t('editor.chart.label.edit') }}</span> |
42-
<span @click="() => removeSlide(item, idx)">{{ $t('editor.remove') }}</span>
42+
<span @click="$vfm.open(`delete-item-${idx}`)">{{ $t('editor.remove') }}</span>
4343
</td>
44+
45+
<confirmation-modal
46+
:name="`delete-item-${idx}`"
47+
:message="$t('dynamic.panel.remove')"
48+
@ok="() => removeSlide(item as any, idx)"
49+
/>
4450
</tr>
4551
<tr class="table-add-row">
4652
<th class="flex flex-col items-center">
@@ -54,7 +60,11 @@
5460
</option>
5561
</select>
5662
</th>
57-
<th><button class="editor-button" @click="createNewSlide" :disabled="idUsed">Add New</button></th>
63+
<th>
64+
<button class="editor-button" @click="createNewSlide" :disabled="idUsed || !newSlideName">
65+
{{ $t('dynamic.panel.add') }}
66+
</button>
67+
</th>
5868
</tr>
5969
</table>
6070

@@ -105,6 +115,7 @@ import TextEditorV from './text-editor.vue';
105115
import MapEditorV from './map-editor.vue';
106116
import VideoEditorV from './video-editor.vue';
107117
import SlideshowEditorV from './slideshow-editor.vue';
118+
import ConfirmationModalV from './helpers/confirmation-modal.vue';
108119
109120
@Options({
110121
components: {
@@ -114,7 +125,8 @@ import SlideshowEditorV from './slideshow-editor.vue';
114125
'slideshow-editor': SlideshowEditorV,
115126
'dynamic-editor': DynamicEditorV,
116127
'map-editor': MapEditorV,
117-
'video-editor': VideoEditorV
128+
'video-editor': VideoEditorV,
129+
'confirmation-modal': ConfirmationModalV
118130
}
119131
})
120132
export default class DynamicEditorV extends Vue {

src/lang/lang.csv

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ dynamic.panel.collection,Panel Collection,1,Collection de panneaux,1
1313
dynamic.panel.id,Panel ID,1,No d’identification du panneau,1
1414
dynamic.panel.type,Panel Type,1,Type de panneaux,1
1515
dynamic.panel.actions,Panel Actions,1,Actions du panneau,1
16-
dynamic.panel.idTaken,Panel ID is already,1,Le nom du panneau est déjà utilisé,1
16+
dynamic.panel.idTaken,Panel ID is already in use,1,Le nom du panneau est déjà utilisé,1
1717
dynamic.panel.editor,Panel Editor:,1,Éditeur de panneaux:,1
18+
dynamic.panel.remove,Are you sure you want to remove this panel?,1,Etes-vous sûr de vouloir supprimer ce panneau?,0
19+
dynamic.panel.add,Add New,1,Ajouter un nouveau,0
1820
timeslider.expand,Expand,1,Développer,1
1921
timeslider.minimize,Minimize,1,Réduire,1
2022
timeslider.play,Play,1,Lecture,1

0 commit comments

Comments
 (0)