From 82243d5208239d1e9babede0531310748419871e Mon Sep 17 00:00:00 2001 From: Rouslan Placella Date: Tue, 18 Dec 2012 17:30:03 +0000 Subject: [PATCH] Check image cache when generating a toggleButton --- js/functions.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/functions.js b/js/functions.js index 9d6d06a558..77c88f8ae4 100644 --- a/js/functions.js +++ b/js/functions.js @@ -3022,8 +3022,14 @@ AJAX.registerTeardown('functions.js', function() { AJAX.registerOnload('functions.js', function () { $('div.toggleAjax').each(function () { var $button = $(this).show(); - $button.find('img').load(function () { - toggleButton($button); + $button.find('img').each(function() { + if (this.complete) { + toggleButton($button); + } else { + $(this).load(function () { + toggleButton($button); + }); + } }); }); });