[yelp-xsl/wip/html5] html.xsl: Do figure resizing on load instead of DOMContentLoaded
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp-xsl/wip/html5] html.xsl: Do figure resizing on load instead of DOMContentLoaded
- Date: Fri, 12 Feb 2016 12:51:15 +0000 (UTC)
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]