mirror of https://github.com/apache/cloudstack.git
UI plugin API: Support IE-compatible CSS loading
If browser is IE < 9, use document.createStyleSheet to properly load plugin's CSS dynamically.
This commit is contained in:
parent
732566e703
commit
5b74b4d6fe
|
|
@ -20,15 +20,20 @@
|
|||
}
|
||||
|
||||
var loadCSS = function(path) {
|
||||
var $link = $('<link>');
|
||||
if (document.createStyleSheet) {
|
||||
// IE-compatible CSS loading
|
||||
document.createStyleSheet(path);
|
||||
} else {
|
||||
var $link = $('<link>');
|
||||
|
||||
$link.attr({
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css',
|
||||
href: path
|
||||
});
|
||||
$link.attr({
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css',
|
||||
href: path
|
||||
});
|
||||
|
||||
$('head').append($link);
|
||||
$('html head').append($link);
|
||||
}
|
||||
};
|
||||
|
||||
$.extend(cloudStack.pluginAPI, {
|
||||
|
|
|
|||
Loading…
Reference in New Issue