diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/App.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/App.vue
index 0f566f464..ac7d30b36 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/App.vue
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/App.vue
@@ -1,8 +1,9 @@
@@ -22,16 +23,6 @@ export default {
},
options() {
return this.onTheFly.options;
- },
- // temp
- action() {
- return 'show'; // 'edit', 'create'
- },
- type() {
- return 'person'; // 'thirdparty'
- },
- id() {
- return 1613
}
},
mounted() {
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/index.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/index.js
index 2b78a569a..46320b091 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/index.js
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/index.js
@@ -14,8 +14,14 @@ containers.forEach((container) => {
data() {
return {
onTheFly: {
- context: {},
- options: {}
+ context: {
+ action: container.dataset.action,
+ type: container.dataset.targetName,
+ id: parseInt(container.dataset.targetId),
+ },
+ options: {
+ buttonText: container.dataset.buttonText || null
+ }
}
}
}
diff --git a/src/Bundle/ChillMainBundle/Resources/views/OnTheFly/_insert_vue_onthefly.html.twig b/src/Bundle/ChillMainBundle/Resources/views/OnTheFly/_insert_vue_onthefly.html.twig
index f43101bbb..03b4094f7 100644
--- a/src/Bundle/ChillMainBundle/Resources/views/OnTheFly/_insert_vue_onthefly.html.twig
+++ b/src/Bundle/ChillMainBundle/Resources/views/OnTheFly/_insert_vue_onthefly.html.twig
@@ -3,10 +3,19 @@
It push all variables from context in OnTheFly/App.vue.
OPTIONS
- *
+ * targetEntity {
+ name: string 'person', 'thirdparty'
+ id: integer
+ }
+ * action 'show', 'edit', 'create'
+
#}
{{ encore_entry_script_tags('vue_onthefly') }}