Don't actually use Blob URL'd stylesheets, they don't get cleared automatically when navigating.

This commit is contained in:
Nicolas Stepien 2013-02-28 00:45:14 +01:00
parent eee15f192e
commit df81ea3815
3 changed files with 7 additions and 17 deletions

View File

@ -742,15 +742,10 @@
return setTimeout($.asap, 25, test, cb);
}
},
addStyle: function(css, type) {
addStyle: function(css) {
var style;
style = type === 'style' || !window.URL ? $.el('style', {
style = $.el('style', {
textContent: css
}) : $.el('link', {
rel: 'stylesheet',
href: URL.createObjectURL(new Blob([css], {
type: 'text/css'
}))
});
$.asap((function() {
return d.head;
@ -4453,7 +4448,7 @@
if (checked) {
$.on(window, 'resize', ImageExpand.resize);
if (!ImageExpand.style) {
ImageExpand.style = $.addStyle(null, 'style');
ImageExpand.style = $.addStyle(null);
}
return ImageExpand.resize();
} else {

View File

@ -88,14 +88,9 @@ $.extend $,
cb()
else
setTimeout $.asap, 25, test, cb
addStyle: (css, type) ->
style = if type is 'style' or !window.URL
$.el 'style',
textContent: css
else
$.el 'link',
rel: 'stylesheet'
href: URL.createObjectURL new Blob([css], type: 'text/css')
addStyle: (css) ->
style = $.el 'style',
textContent: css
$.asap (-> d.head), ->
$.add d.head, style
style

View File

@ -2948,7 +2948,7 @@ ImageExpand =
if checked
$.on window, 'resize', ImageExpand.resize
unless ImageExpand.style
ImageExpand.style = $.addStyle null, 'style'
ImageExpand.style = $.addStyle null
ImageExpand.resize()
else
$.off window, 'resize', ImageExpand.resize