2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 12:35:46 +00:00

Simplified javascript templating

- Load js modules in block js_load
- Write $(document).ready script in block js_ready
- Write any other js in block_js
This commit is contained in:
Oliver
2018-04-28 12:45:12 +10:00
parent 7ebb723d15
commit 095492203f
18 changed files with 68 additions and 138 deletions

View File

@ -64,14 +64,12 @@
{% endblock %}
{% block javascript %}
{% block js_load %}
<script type='text/javascript' src="{% static 'script/footable.js' %}"></script>
<script type='text/javascript' src="{% static 'script/modal_form.js' %}"></script>
{% endblock %}
<script type='text/javascript'>
$(document).ready(function () {
{% block js_ready %}
$("#build-list").footable();
$("#edit-build").click(function () {
@ -81,8 +79,4 @@ $(document).ready(function () {
reload: true
});
});
});
</script>
{% endblock %}
{% endblock %}

View File

@ -22,15 +22,10 @@
{% endblock %}
{% block javascript %}
{% block js_load %}
<script type='text/javascript' src="{% static 'script/footable.js' %}"></script>
<script type='text/javascript' src="{% static 'script/modal_form.js' %}"></script>
<script type="text/javascript">
$(document).ready(function () {
{% endblock %}
{% block js_ready %}
$('#build-list').footable();
});
</script>
{% endblock %}