Skip to content

Commit 23a0b49

Browse files
committed
Dynamic event binding based on the loaded template. Async compute CSS variables.
1 parent 18b1c9a commit 23a0b49

File tree

1 file changed

+12
-45
lines changed

1 file changed

+12
-45
lines changed

src/components/Activity.vue

Lines changed: 12 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -13,44 +13,14 @@
1313
</template>
1414
<v-spacer></v-spacer>
1515
<v-toolbar-items>
16-
<!-- template serves as an invisible wrapper to conditional render more than one element -->
1716
<template v-if="status == 200">
18-
<v-btn v-on:click="runProgramLegacy()" flat>
19-
<v-icon>play_arrow</v-icon>
20-
Esegui
21-
</v-btn>
22-
<!--
23-
<v-btn v-if="isDefault != 'True'" @click="overwrite = 1, saveProgram()" flat>
24-
<v-icon>save</v-icon>
25-
Salva
26-
</v-btn>
27-
<v-btn @click="salva = true, newProgramName = programName" flat>
28-
<v-icon>edit</v-icon>
29-
Salva con nome
30-
</v-btn>
31-
<v-btn @click="loadProgramList" flat>
32-
<v-icon>folder_open</v-icon>
33-
Carica
34-
</v-btn>
35-
36-
<v-btn v-on:click="getProgramCode()" flat>
37-
<v-icon>code</v-icon>
38-
Mostra codice
39-
</v-btn>
40-
<v-btn v-on:click="exportProgram()" flat>
41-
<v-icon>fa-file-export</v-icon>
42-
&nbsp;&nbsp;Esporta
43-
</v-btn>
44-
<v-btn v-on:click="pickFile()" flat>
45-
<v-icon>fa-file-import</v-icon>
46-
&nbsp;&nbsp;Importa
47-
</v-btn>
48-
</template>
49-
<template v-else>
50-
<v-btn flat>
51-
<v-progress-circular :size="30" :width="2" indeterminate></v-progress-circular>
52-
</v-btn>
53-
-->
17+
<template v-for="button, i in activity.buttons">
18+
<v-btn @click="_self[button.action]()" style="height: 70%" :color="button.colorBtn" :class="button.colorText">
19+
{{ button.label }}
20+
<v-icon right dark>{{ button.icon }}</v-icon>
21+
</v-btn>
22+
&nbsp;&nbsp;
23+
</template>
5424
</template>
5525
<!--
5626
<v-btn @click="dialog = true" icon v-if="status == 200">
@@ -63,7 +33,6 @@
6333
</v-toolbar-items>
6434
</v-toolbar>
6535
<v-content>
66-
6736
<div style="height: 480px; width: 600px;">
6837
<div ref="blocklyTotal" style="height: 100%; width: 100%;" class="blocklyTotal">
6938
<div ref="blocklyArea" style="height: 100%; width: 100%;" class="blocklyArea">
@@ -72,7 +41,6 @@
7241
</div>
7342
</div>
7443
</div>
75-
7644
</v-content>
7745
<!-- Runtime modal -->
7846
<v-dialog v-model="runtimeDialog" width="500">
@@ -279,10 +247,10 @@ export default {
279247
import('vue-prism-component')
280248
},
281249
data: () => ({
282-
cssProps : {
283-
'--bodyFont': 'Roboto',
284-
'--codeFont': 'Ubuntu Mono',
285-
},
250+
cssProps: {
251+
'--bodyFont': 'Roboto',
252+
'--codeFont': 'Ubuntu Mono',
253+
},
286254
activityStyle: null,
287255
activity: null,
288256
log: null,
@@ -382,8 +350,7 @@ export default {
382350
let textTransform = ''
383351
if (this.activity.capsSwitch) {
384352
textTransform = 'uppercase'
385-
}
386-
else{
353+
} else {
387354
textTransform = 'none'
388355
}
389356

0 commit comments

Comments
 (0)