Fix bubble.js initialization

This commit is contained in:
Emmanuel Viennet 2024-06-25 19:08:48 +02:00
parent c88191b0ca
commit 74b9816713
2 changed files with 24 additions and 5 deletions

View File

@ -100,7 +100,14 @@ _HTML_BEGIN = f"""<!DOCTYPE html>
<script src="{scu.STATIC_DIR}/libjs/menu.js"></script>
<script src="{scu.STATIC_DIR}/libjs/bubble.js"></script>
<script>
window.onload=function(){{enableTooltips("gtrcontent"); enableTooltips("sidebar");}};
window.onload=function(){{
if (document.getElementById('gtrcontent')) {{
enableTooltips("gtrcontent");
}}
if (document.getElementById('sidebar')) {{
enableTooltips("sidebar");
}}
}};
</script>
<script src="{scu.STATIC_DIR}/jQuery/jquery.js"></script>
@ -217,8 +224,14 @@ def sco_header(
<script src="{scu.STATIC_DIR}/libjs/menu.js"></script>
<script src="{scu.STATIC_DIR}/libjs/bubble.js"></script>
<script>
window.onload=function(){{enableTooltips("gtrcontent"); enableTooltips("sidebar");}};
window.onload=function(){{
if (document.getElementById('gtrcontent')) {{
enableTooltips("gtrcontent");
}}
if (document.getElementById('sidebar')) {{
enableTooltips("sidebar");
}}
}};
const SCO_URL="{url_for("scolar.index_html", scodoc_dept=g.scodoc_dept)}";
const SCO_TIMEZONE="{scu.TIME_ZONE}";
</script>"""

View File

@ -49,8 +49,14 @@
<script src="{{scu.STATIC_DIR}}/js/scodoc.js"></script>
<script src="{{scu.STATIC_DIR}}/DataTables/datatables.min.js"></script>
<script>
window.onload = function () { enableTooltips("gtrcontent"); enableTooltips("sidebar"); };
window.onload = function () {
if (document.getElementById('gtrcontent')) {
enableTooltips("gtrcontent");
}
if (document.getElementById('sidebar')) {
enableTooltips("sidebar");
}
};
const SCO_URL = "{{ url_for('scolar.index_html', scodoc_dept=g.scodoc_dept) }}";
</script>