[yelp-xsl/wip/html5] html.xsl: Do figure resizing on load instead of DOMContentLoaded



commit 47fdba50ee641f828a95c4a8e44d48001303c563
Author: Shaun McCance <shaunm gnome org>
Date:   Tue Feb 9 14:21:30 2016 -0500

    html.xsl: Do figure resizing on load instead of DOMContentLoaded
    
    This code queries the size of images, which might not be set yet on
    DOMContentLoaded. Using load ensures the images are loaded.

 xslt/common/html.xsl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/xslt/common/html.xsl b/xslt/common/html.xsl
index 45ad471..52f96fa 100644
--- a/xslt/common/html.xsl
+++ b/xslt/common/html.xsl
@@ -2162,7 +2162,7 @@ function yelp_figure_init (figure) {
     return false;
   };
 }
-document.addEventListener('DOMContentLoaded', function() {
+window.addEventListener('load', function() {
   var figures = document.querySelectorAll('div.figure');
   for (var i = 0; i < figures.length; i++) {
     if (figures[i].querySelector('img') != null)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]