Skip to content

Commit f26124c

Browse files
committed
bug symfony#2763 [Map] add definition to after create events in controller (mart-insiders)
This PR was merged into the 2.x branch. Discussion ---------- [Map] add definition to after create events in controller | Q | A | ------------- | --- | Bug fix? | yes | New feature? | | Docs? | no | Issues | Fix | License | MIT Hi, The [documentation](https://symfony.com/bundles/ux-map/current/index.html#advanced-passing-extra-data-from-php-to-the-stimulus-controller )states that the definition should be accessible in the <type>:after-create events in the map controllers. Commits ------- e58c9b9 [Map] add definition to after create events in controller
2 parents cb3eb2a + e58c9b9 commit f26124c

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/Map/assets/dist/abstract_map_controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class default_1 extends Controller {
4343
createInfoWindow({ definition, element, }) {
4444
this.dispatchEvent('info-window:before-create', { definition, element });
4545
const infoWindow = this.doCreateInfoWindow({ definition, element });
46-
this.dispatchEvent('info-window:after-create', { infoWindow, element });
46+
this.dispatchEvent('info-window:after-create', { infoWindow, definition, element });
4747
this.infoWindows.push(infoWindow);
4848
return infoWindow;
4949
}
@@ -74,7 +74,7 @@ class default_1 extends Controller {
7474
return ({ definition }) => {
7575
this.dispatchEvent(eventBefore, { definition });
7676
const drawing = factory({ definition });
77-
this.dispatchEvent(eventAfter, { [type]: drawing });
77+
this.dispatchEvent(eventAfter, { [type]: drawing, definition });
7878
draws.set(definition['@id'], drawing);
7979
return drawing;
8080
};

src/Map/assets/src/abstract_map_controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export default abstract class<
206206
}): InfoWindow {
207207
this.dispatchEvent('info-window:before-create', { definition, element });
208208
const infoWindow = this.doCreateInfoWindow({ definition, element });
209-
this.dispatchEvent('info-window:after-create', { infoWindow, element });
209+
this.dispatchEvent('info-window:after-create', { infoWindow, definition, element });
210210

211211
this.infoWindows.push(infoWindow);
212212

@@ -334,7 +334,7 @@ export default abstract class<
334334
return ({ definition }: { definition: WithIdentifier<any> }) => {
335335
this.dispatchEvent(eventBefore, { definition });
336336
const drawing = factory({ definition }) as Draw;
337-
this.dispatchEvent(eventAfter, { [type]: drawing });
337+
this.dispatchEvent(eventAfter, { [type]: drawing, definition });
338338

339339
draws.set(definition['@id'], drawing);
340340

src/Map/src/Bridge/Google/assets/dist/map_controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class default_1 extends Controller {
4444
createInfoWindow({ definition, element, }) {
4545
this.dispatchEvent('info-window:before-create', { definition, element });
4646
const infoWindow = this.doCreateInfoWindow({ definition, element });
47-
this.dispatchEvent('info-window:after-create', { infoWindow, element });
47+
this.dispatchEvent('info-window:after-create', { infoWindow, definition, element });
4848
this.infoWindows.push(infoWindow);
4949
return infoWindow;
5050
}
@@ -75,7 +75,7 @@ class default_1 extends Controller {
7575
return ({ definition }) => {
7676
this.dispatchEvent(eventBefore, { definition });
7777
const drawing = factory({ definition });
78-
this.dispatchEvent(eventAfter, { [type]: drawing });
78+
this.dispatchEvent(eventAfter, { [type]: drawing, definition });
7979
draws.set(definition['@id'], drawing);
8080
return drawing;
8181
};

src/Map/src/Bridge/Leaflet/assets/dist/map_controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class default_1 extends Controller {
4545
createInfoWindow({ definition, element, }) {
4646
this.dispatchEvent('info-window:before-create', { definition, element });
4747
const infoWindow = this.doCreateInfoWindow({ definition, element });
48-
this.dispatchEvent('info-window:after-create', { infoWindow, element });
48+
this.dispatchEvent('info-window:after-create', { infoWindow, definition, element });
4949
this.infoWindows.push(infoWindow);
5050
return infoWindow;
5151
}
@@ -76,7 +76,7 @@ class default_1 extends Controller {
7676
return ({ definition }) => {
7777
this.dispatchEvent(eventBefore, { definition });
7878
const drawing = factory({ definition });
79-
this.dispatchEvent(eventAfter, { [type]: drawing });
79+
this.dispatchEvent(eventAfter, { [type]: drawing, definition });
8080
draws.set(definition['@id'], drawing);
8181
return drawing;
8282
};

0 commit comments

Comments
 (0)