forked from SymfonyCasts/symfony-ux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodalframe-remove-extra-stuff.diff
57 lines (52 loc) · 1.75 KB
/
modalframe-remove-extra-stuff.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
diff --git a/assets/controllers/modal-form_controller.js b/assets/controllers/modal-form_controller.js
index 0d0afbc..ad3b749 100644
--- a/assets/controllers/modal-form_controller.js
+++ b/assets/controllers/modal-form_controller.js
@@ -1,19 +1,10 @@
import { Controller } from 'stimulus';
import { Modal } from 'bootstrap';
-import $ from 'jquery';
-import { useDispatch } from 'stimulus-use';
export default class extends Controller {
static targets = ['modal'];
- static values = {
- formUrl: String,
- }
modal = null;
- connect() {
- useDispatch(this);
- }
-
async openModal(event) {
this.modal = new Modal(this.modalTarget);
this.modal.show();
diff --git a/templates/product_admin/index.html.twig b/templates/product_admin/index.html.twig
index 93766ec..6c8b0d4 100644
--- a/templates/product_admin/index.html.twig
+++ b/templates/product_admin/index.html.twig
@@ -5,18 +5,12 @@
{% block body %}
<div
class="container-fluid container-xl mt-4"
- {{ stimulus_controller('reload-content', {
- url: path('product_admin_index', { ajax: 1 })
- }) }}
- data-action="modal-form:success->reload-content#refreshContent"
>
<div class="d-flex flex-row">
<h1 class="me-3 mb-4">Product index</h1>
<div
- {{ stimulus_controller('modal-form', {
- formUrl: path('product_admin_new')
- }) }}
+ {{ stimulus_controller('modal-form') }}
>
<button
class="btn btn-primary btn-sm"
@@ -31,7 +25,7 @@
</div>
</div>
- <div data-reload-content-target="content" class="table-responsive">
+ <div class="table-responsive">
{{ include('product_admin/_list.html.twig') }}
</div>