Permalink
Browse files

Bugfix in demos: Buttons were not showing up when using RequireJS or …

…curl.
  • Loading branch information...
1 parent b7b8f73 commit 5b55fe06995917561bcbc825e9651449a40db6c8 @tubalmartin committed May 29, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 demos/scripts/main.js
View
@@ -120,7 +120,7 @@
// Buttons will show up when window is loaded
// Although this works x-browser, this code is shit so don't use it!!
- window.onload = function() {
+ function activateButtons() {
var group2Container = document.getElementById('group2'),
group2Button = document.getElementById('group2-button'),
group2ImageNames = [
@@ -168,5 +168,11 @@
group4.riload();
};
- };
+ }
+
+ if (document.readyState === 'complete') {
+ activateButtons();
+ } else {
+ window.onload = activateButtons;
+ }
});

0 comments on commit 5b55fe0

Please sign in to comment.