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

Inline sendUrl

parent 66cb128b
Branches
No related tags found
No related merge requests found
...@@ -291,7 +291,8 @@ export class QrCodeScanner extends ScopedElementsMixin(DBPLitElement) { ...@@ -291,7 +291,8 @@ export class QrCodeScanner extends ScopedElementsMixin(DBPLitElement) {
if (code) { if (code) {
if (lastSentData !== code.data) { if (lastSentData !== code.data) {
that._outputData = code.data; that._outputData = code.data;
that.sendUrl(code.data); that.dispatchEvent(new CustomEvent("code-detected",
{bubbles: true, composed: true, detail: {'code': code.data}}));
} }
lastSentData = code.data; lastSentData = code.data;
} else { } else {
...@@ -341,17 +342,6 @@ export class QrCodeScanner extends ScopedElementsMixin(DBPLitElement) { ...@@ -341,17 +342,6 @@ export class QrCodeScanner extends ScopedElementsMixin(DBPLitElement) {
this._loadingMessage = ''; this._loadingMessage = '';
} }
/**
* Sends an event with the data which is detected from QR code reader
*
* @param data
*/
sendUrl(data) {
const event = new CustomEvent("code-detected",
{ bubbles: true, composed: true , detail: {'code': data}});
this.dispatchEvent(event);
}
static get styles() { static get styles() {
// language=css // language=css
return css` return css`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment