summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2012-05-04 08:24:45 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2012-05-04 08:24:45 (GMT)
commitb5325137f71f6850b4be1aacefacf7a30b26637b (patch)
tree11a3058a54a9fc16ad6d567e01f1e40f839f4981
parent6719016cdc7efc8cf701b7e55512540e3bba1fd5 (diff)
downloadtabellio.webviews-b5325137f71f6850b4be1aacefacf7a30b26637b.zip
tabellio.webviews-b5325137f71f6850b4be1aacefacf7a30b26637b.tar.gz
tabellio.webviews-b5325137f71f6850b4be1aacefacf7a30b26637b.tar.bz2
delay loading of deputies pictures after the page is fully loaded
-rw-r--r--tabellio/webviews/deputy_and_others_folder.pt14
1 files changed, 11 insertions, 3 deletions
diff --git a/tabellio/webviews/deputy_and_others_folder.pt b/tabellio/webviews/deputy_and_others_folder.pt
index 0994eb9..0778fb7 100644
--- a/tabellio/webviews/deputy_and_others_folder.pt
+++ b/tabellio/webviews/deputy_and_others_folder.pt
@@ -27,11 +27,19 @@
<dt id="fieldsetlegend-photographies">Répertoire photos de A-Z</dt>
<dd id="fieldset-photographies">
+<script type="text/javascript">
+/* delay loading of deputies photos after the page is fully loaded */
+jQuery(window).load(function(){
+ $('#fieldset-photographies a').each(function() {
+ $(this).find('span').before('<img src="' + $(this).attr('data-src') + '"/>');
+ });
+});
+</script>
<tal:block tal:repeat="entry view/sortedDeputies">
<div tal:condition="entry/picture">
- <a tal:attributes="href entry/absolute_url"><img
- tal:attributes="src string:${entry/id}/photo"/>
- <span tal:content="entry/Title"/>
+ <a tal:attributes="href entry/absolute_url;
+ data-src string:${entry/id}/photo;">
+ <span tal:content="entry/Title"/>
</a>
</div>
</tal:block>