mirror of
https://github.com/Cian-H/invenio-theme-iform.git
synced 2026-05-09 08:51:43 +01:00
separate html and javascript code
the function hide was in the header.html file enclosed by script tags. it has been moved to the theme.js file. to make it run it was necessary to add a entry point to the WebpackThemeBundle instance in webpack.py (render the js file) and include the resulting js file manually in footer.html (to be loaded in the browser).
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
export function hide() {
|
||||
var x = document.getElementById('heading');
|
||||
|
||||
if (x.style.display === "none") {
|
||||
x.style.display = "block";
|
||||
} else {
|
||||
x.style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
window.hide = hide;
|
||||
@@ -12,6 +12,10 @@
|
||||
{{ webpack['invenio-theme-tugraz-theme.css'] }}
|
||||
{%- endblock %}
|
||||
|
||||
{%- block javascript %}
|
||||
{{ webpack['invenio-theme-tugraz-js.js'] }}
|
||||
{%- endblock javascript %}
|
||||
|
||||
<footer id="footer" class="footer-bottom">
|
||||
<div class="ui grid container">
|
||||
<div class="eight wide column left aligned">
|
||||
|
||||
@@ -220,20 +220,6 @@
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
||||
<script>
|
||||
function hide() {
|
||||
var x = document.getElementById('heading');
|
||||
|
||||
if (x.style.display === "none") {
|
||||
x.style.display = "block";
|
||||
} else {
|
||||
x.style.display = "none";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
{%- block flashmessages %}
|
||||
{%- from "invenio_theme/macros/messages.html" import flashed_messages with context -%}
|
||||
{{ flashed_messages() }}
|
||||
|
||||
@@ -17,6 +17,8 @@ theme = WebpackThemeBundle(
|
||||
entry={
|
||||
'invenio-theme-tugraz-theme':
|
||||
'./less/invenio_theme_tugraz/theme.less',
|
||||
'invenio-theme-tugraz-js':
|
||||
'./js/invenio_theme_tugraz/theme.js'
|
||||
},
|
||||
dependencies={}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user