Close #753.
This commit is contained in:
parent
1d267e0541
commit
9329c7ce6e
@ -402,11 +402,19 @@
|
||||
}
|
||||
},
|
||||
addStyle: function(css) {
|
||||
var style;
|
||||
var f, style;
|
||||
style = $.el('style', {
|
||||
textContent: css
|
||||
});
|
||||
$.add(d.head || d.documentElement, style);
|
||||
f = function() {
|
||||
var root;
|
||||
if (root = d.head || d.documentElement) {
|
||||
return $.add(root, style);
|
||||
} else {
|
||||
return setTimeout(f, 20);
|
||||
}
|
||||
};
|
||||
f();
|
||||
return style;
|
||||
},
|
||||
x: function(path, root) {
|
||||
|
||||
@ -315,8 +315,16 @@ $.extend $,
|
||||
addStyle: (css) ->
|
||||
style = $.el 'style',
|
||||
textContent: css
|
||||
# XXX Only Chrome has no d.head on document-start.
|
||||
$.add d.head or d.documentElement, style
|
||||
# That's terrible.
|
||||
# XXX tmp fix for scriptish:
|
||||
# https://github.com/scriptish/scriptish/issues/16
|
||||
f = ->
|
||||
# XXX Only Chrome has no d.head on document-start.
|
||||
if root = d.head or d.documentElement
|
||||
$.add root, style
|
||||
else
|
||||
setTimeout f, 20
|
||||
f()
|
||||
style
|
||||
x: (path, root=d.body) ->
|
||||
# XPathResult.ANY_UNORDERED_NODE_TYPE is 8
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user