2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 04:55:44 +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

@ -5,6 +5,6 @@
{% endblock %}
{% block javascript %}
{% block js_load %}
{% endblock %}

View File

@ -41,9 +41,20 @@ InvenTree
<script type="text/javascript" src="{% static 'script/jquery_3.3.1_jquery.min.js' %}"></script>
<script type="text/javascript" src="{% static 'script/bootstrap.min.js' %}"></script>
<script type="text/javascript" src="{% static 'script/select2/select2.js' %}"></script>
{% block js_load %}
{% endblock %}
{% block javascript %}
<script type='text/javascript'>
$(document).ready(function () {
{% block js_ready %}
{% endblock %}
});
</script>
{% block js %}
{% endblock %}
</body>