Skip to content

Commit 41a3119

Browse files
committed
Fix #14: Run (or any button with notErasable set) can't be deleted or changed bound action. A small text notifies about this.
1 parent b4a5693 commit 41a3119

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/ActivityEditor.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,15 @@
170170
</v-btn>
171171
<br><br>
172172
<div v-for="button, i in activity.buttons">
173-
<h3>Pulsante {{i + 1}} <v-btn @click="removeButton(i)" flat icon>
173+
<h3>Pulsante {{i + 1}}
174+
<v-btn @click="removeButton(i)" flat icon v-if="!button.notErasable">
174175
<v-icon>clear</v-icon>
175176
</v-btn></h3>
176177
<v-card>
177178
<div class="cardContent">
179+
<span class="grey--text text--darken-2" v-if="button.notErasable"> "Esegui" non può essere eliminato </span>
178180
<v-text-field v-model="button.label" label="Etichetta"></v-text-field>
179-
<v-select v-model="button.action" :items="actions" label="Azione">
181+
<v-select v-model="button.action" :items="actions" label="Azione" :disabled="button.notErasable">
180182
</v-select>
181183
<v-select :items="textColors" v-model="button.colorText" label="Colore testo"></v-select>
182184
Colore Pulsante <swatches v-model="button.colorBtn"></swatches>
@@ -418,7 +420,8 @@ export default {
418420
icon: 'play_arrow',
419421
colorBtn: 'green',
420422
colorText: 'white--text',
421-
action: 'runProgramLegacy'
423+
action: 'runProgramLegacy',
424+
notErasable: true
422425
},
423426
{
424427
label: 'Salva',

0 commit comments

Comments
 (0)