Skip to content

Commit ba2abd9

Browse files
committed
Fixed BN Code issue related to all Scirpts
1 parent 84db731 commit ba2abd9

File tree

1 file changed

+9
-4
lines changed
  • app/code/Magento/Paypal/view/frontend/web/js/in-context

1 file changed

+9
-4
lines changed

app/code/Magento/Paypal/view/frontend/web/js/in-context/paypal-sdk.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,19 @@ define([
2525
exports: 'paypal'
2626
}
2727
},
28+
attributes: {
29+
"paypalSdk": dataAttributes
30+
},
2831

2932
/**
3033
* Add attributes under Paypal SDK Script tag
3134
*/
32-
onNodeCreated: function (node) {
33-
$.each(dataAttributes, function (index, elem) {
34-
node.setAttribute(index, elem);
35-
});
35+
onNodeCreated: function(node, config, name){
36+
if(config.attributes && config.attributes[name]){
37+
$.each(dataAttributes, function (index, elem) {
38+
node.setAttribute(index, elem);
39+
});
40+
}
3641
}
3742
});
3843

0 commit comments

Comments
 (0)