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:
@ -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' %}",
|
||||
|
@ -105,6 +105,14 @@
|
||||
);
|
||||
});
|
||||
|
||||
$("#toggle-starred").click(function() {
|
||||
toggleStar({
|
||||
part: {{ part.id }},
|
||||
user: {{ user.id }},
|
||||
button: '#part-star-icon'
|
||||
});
|
||||
});
|
||||
|
||||
$('#toggle-starred').click(function() {
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user