From 8dd1a3e3e870ca02bd9567b197b0cd9c5f4fb285 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sun, 15 Sep 2013 10:42:50 +1000 Subject: [PATCH] wait for stylesheet to load? --- js/quick-reply.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/quick-reply.js b/js/quick-reply.js index a35047aa..c190d6d4 100644 --- a/js/quick-reply.js +++ b/js/quick-reply.js @@ -85,8 +85,6 @@ var do_css = function() { }\ }\ ').appendTo($('head')); - - console.log('h'); }; var show_quick_reply = function(){ @@ -206,7 +204,12 @@ var show_quick_reply = function(){ $postForm.fadeOut(100); else $postForm.fadeIn(100); - }).on('stylesheet', do_css); + }).on('stylesheet', function() { + do_css(); + if ($('link#stylesheet').attr('href')) { + $('link#stylesheet')[0].onload = do_css; + } + }); }; $(window).on('cite', function(e, id, with_link) {