mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-02 12:19:11 +00:00
Remove obsolete stylesheet helper
This commit is contained in:
parent
828fc9dcd0
commit
b26a32b93a
@ -60,27 +60,6 @@ exports.toggleClass = function(el,className,status) {
|
||||
}
|
||||
};
|
||||
|
||||
exports.applyStyleSheet = function(id,css) {
|
||||
var el = document.getElementById(id);
|
||||
if(document.createStyleSheet) { // Older versions of IE
|
||||
if(el) {
|
||||
el.parentNode.removeChild(el);
|
||||
}
|
||||
document.getElementsByTagName("head")[0].insertAdjacentHTML("beforeEnd",
|
||||
' <style id="' + id + '" type="text/css">' + css + '</style>'); // fails without
|
||||
} else { // Modern browsers
|
||||
if(el) {
|
||||
el.replaceChild(document.createTextNode(css), el.firstChild);
|
||||
} else {
|
||||
el = document.createElement("style");
|
||||
el.type = "text/css";
|
||||
el.id = id;
|
||||
el.appendChild(document.createTextNode(css));
|
||||
document.getElementsByTagName("head")[0].appendChild(el);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Get the scroll position of the viewport
|
||||
Returns:
|
||||
|
Loading…
Reference in New Issue
Block a user