2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 21:45:39 +00:00

Toggle part star status using AJAX

This commit is contained in:
Oliver Walters
2019-05-05 11:18:38 +10:00
parent d2d248c72e
commit fc5fd5e477
4 changed files with 72 additions and 5 deletions

View File

@ -1,5 +1,7 @@
{% extends "base.html" %}
{% load static %}
{% block sidenav %}
<div id='part-tree'></div>
{% endblock %}
@ -14,6 +16,11 @@
{% endblock %}
{% block js_load %}
{{ block.super }}
<script type='text/javascript' src="{% static 'script/inventree/part.js' %}"></script>
{% endblock %}
{% block js_ready %}
{{ block.super }}
loadTree("{% url 'api-part-tree' %}",

View File

@ -105,6 +105,14 @@
);
});
$("#toggle-starred").click(function() {
toggleStar({
part: {{ part.id }},
user: {{ user.id }},
button: '#part-star-icon'
});
});
$('#toggle-starred').click(function() {
});