improved dynamic CSS handling

This commit is contained in:
Shaun Walker
2019-09-20 09:52:40 -04:00
parent c3ff9ff12b
commit ddf7cdbec7
4 changed files with 45 additions and 0 deletions

View File

@ -38,6 +38,16 @@ window.interop = {
head.appendChild(link);
},
removeCSS: function (filePattern) {
var head = document.head;
var links = document.getElementsByTagName("link");
for (var i = 0; i < links.length; i++) {
var link = links[i];
if (link.rel === 'stylesheet' && link.href.includes(filePattern)) {
head.removeChild(link);
}
}
},
submitForm: function (path, fields) {
const form = document.createElement('form');
form.method = 'post';