Skip to content
Snippets Groups Projects
Commit 8598d6ab authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Make the event name shorter and send an object instead of just the data

This way we can extend the message with more data in the future if needed.
parent c7fda44b
No related branches found
No related tags found
No related merge requests found
Pipeline #13644 passed
......@@ -31,7 +31,7 @@ after loaded. This attribute is also used to stop the QR code reader or if you d
## Events
- `'dbp-qr-code-scanner-data'`: Outgoing Event which is fired if a QR code is detected. The data of the detected QR code is in `event.detail`.
- `'code-detected'`: Outgoing Event which is fired if a QR code is detected. The data of the detected QR code is in `event.detail`.
## Local development
......
......@@ -352,8 +352,8 @@ export class QrCodeScanner extends ScopedElementsMixin(DBPLitElement) {
* @param data
*/
sendUrl(data) {
const event = new CustomEvent("dbp-qr-code-scanner-data",
{ bubbles: true, composed: true , detail: data});
const event = new CustomEvent("code-detected",
{ bubbles: true, composed: true , detail: {'code': data}});
this.dispatchEvent(event);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment