Don't remove whole head when appending a stylesheet for a plugin (#1092)
This commit is contained in:
parent
a61bf6832d
commit
47c0a5a093
@ -463,8 +463,10 @@ plugins.factory('userPlugins', function() {
|
|||||||
jsonp(url, function(data) {
|
jsonp(url, function(data) {
|
||||||
// Add the gist stylesheet only once
|
// Add the gist stylesheet only once
|
||||||
if (document.querySelectorAll('link[rel=stylesheet][href="' + data.stylesheet + '"]').length < 1) {
|
if (document.querySelectorAll('link[rel=stylesheet][href="' + data.stylesheet + '"]').length < 1) {
|
||||||
var stylesheet = '<link rel="stylesheet" href="' + data.stylesheet + '"></link>';
|
var stylesheet = document.createElement("link");
|
||||||
document.getElementsByTagName('head')[0].innerHTML += stylesheet;
|
stylesheet.href = data.stylesheet;
|
||||||
|
stylesheet.setAttribute('rel', 'stylesheet');
|
||||||
|
document.head.appendChild(stylesheet);
|
||||||
}
|
}
|
||||||
element.innerHTML = '<div style="clear:both">' + data.div + '</div>';
|
element.innerHTML = '<div style="clear:both">' + data.div + '</div>';
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user