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

View File

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

View File

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