You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by al...@apache.org on 2013/05/08 22:48:38 UTC
[72/90] [abbrv] git commit: updated refs/heads/internallb to 1b8a698
UI plugin API: Support IE-compatible CSS loading
If browser is IE < 9, use document.createStyleSheet to properly load
plugin's CSS dynamically.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5b74b4d6
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5b74b4d6
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5b74b4d6
Branch: refs/heads/internallb
Commit: 5b74b4d6fe68e81d76ce8743c017201212f0d7aa
Parents: 732566e
Author: Brian Federle <br...@citrix.com>
Authored: Tue May 7 15:44:28 2013 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Tue May 7 15:44:59 2013 -0700
----------------------------------------------------------------------
ui/scripts/plugins.js | 19 ++++++++++++-------
1 files changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b74b4d6/ui/scripts/plugins.js
----------------------------------------------------------------------
diff --git a/ui/scripts/plugins.js b/ui/scripts/plugins.js
index 122f4a0..6a886ba 100644
--- a/ui/scripts/plugins.js
+++ b/ui/scripts/plugins.js
@@ -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, {