add support for type attribute in JSInterop IncludeScript
This commit is contained in:
@ -108,7 +108,7 @@ Oqtane.Interop = {
|
||||
}
|
||||
}
|
||||
},
|
||||
includeScript: function (id, src, integrity, crossorigin, content, location) {
|
||||
includeScript: function (id, src, integrity, crossorigin, type, content, location) {
|
||||
var script;
|
||||
if (src !== "") {
|
||||
script = document.querySelector("script[src=\"" + CSS.escape(src) + "\"]");
|
||||
@ -121,6 +121,9 @@ Oqtane.Interop = {
|
||||
if (id !== "") {
|
||||
script.id = id;
|
||||
}
|
||||
if (type !== "") {
|
||||
script.type = type;
|
||||
}
|
||||
if (src !== "") {
|
||||
script.src = src;
|
||||
if (integrity !== "") {
|
||||
@ -146,6 +149,13 @@ Oqtane.Interop = {
|
||||
if (script.id !== id) {
|
||||
script.setAttribute('id', id);
|
||||
}
|
||||
if (type !== "") {
|
||||
if (script.type !== type) {
|
||||
script.setAttribute('type', type);
|
||||
}
|
||||
} else {
|
||||
script.removeAttribute('type');
|
||||
}
|
||||
if (src !== "") {
|
||||
if (script.src !== this.getAbsoluteUrl(src)) {
|
||||
script.removeAttribute('integrity');
|
||||
|
Reference in New Issue
Block a user