@elastic/apm-rum-core
Advanced tools
Comparing version 5.21.0 to 5.21.1
@@ -71,8 +71,11 @@ import { USER_INTERACTION } from '../constants'; | ||
function findCustomTransactionName(target) { | ||
var trCustomNameAttribute = 'data-transaction-name'; | ||
var fallbackName = target.getAttribute(trCustomNameAttribute); | ||
if (target.closest) { | ||
var element = target.closest(INTERACTIVE_SELECTOR); | ||
return element ? element.dataset.transactionName : null; | ||
return element ? element.getAttribute(trCustomNameAttribute) : fallbackName; | ||
} | ||
return target.dataset.transactionName; | ||
return fallbackName; | ||
} |
@@ -78,8 +78,11 @@ "use strict"; | ||
function findCustomTransactionName(target) { | ||
var trCustomNameAttribute = 'data-transaction-name'; | ||
var fallbackName = target.getAttribute(trCustomNameAttribute); | ||
if (target.closest) { | ||
var element = target.closest(INTERACTIVE_SELECTOR); | ||
return element ? element.dataset.transactionName : null; | ||
return element ? element.getAttribute(trCustomNameAttribute) : fallbackName; | ||
} | ||
return target.dataset.transactionName; | ||
return fallbackName; | ||
} |
{ | ||
"name": "@elastic/apm-rum-core", | ||
"version": "5.21.0", | ||
"version": "5.21.1", | ||
"description": "Elastic apm core", | ||
@@ -46,3 +46,3 @@ "license": "MIT", | ||
], | ||
"gitHead": "242cb41a092b88a3e832fdaf9bb970b7b8d272cf" | ||
"gitHead": "15c071ca7a4fd6dc3685888736aec1b9ffd3f1c1" | ||
} |
@@ -111,2 +111,4 @@ /** | ||
function findCustomTransactionName(target) { | ||
const trCustomNameAttribute = 'data-transaction-name' | ||
const fallbackName = target.getAttribute(trCustomNameAttribute) | ||
if (target.closest) { | ||
@@ -116,7 +118,7 @@ // Leverage closest API to traverse the element and its parents | ||
const element = target.closest(INTERACTIVE_SELECTOR) | ||
return element ? element.dataset.transactionName : null | ||
return element ? element.getAttribute(trCustomNameAttribute) : fallbackName | ||
} | ||
// browsers which don't support closest API will just look at the target element | ||
return target.dataset.transactionName | ||
// browsers (such as IE11) which don't support closest API will just look at the target element | ||
return fallbackName | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
538312
15973