mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-20 22:06:28 +00:00
Fix for weird button toggles (it was a doozy!)
- Turning off autocomplete seems to have done the job - https://stackoverflow.com/questions/36546775/html-checkboxes-keep-checked-after-refresh#36547079
This commit is contained in:
@ -218,14 +218,13 @@
|
||||
{{ block.super }}
|
||||
|
||||
$(".slidey").change(function() {
|
||||
var field = $(this).attr('field');
|
||||
var field = $(this).attr('fieldname');
|
||||
|
||||
var checked = $(this).prop('checked');
|
||||
|
||||
var data = {};
|
||||
|
||||
data[field] = checked;
|
||||
|
||||
// Update the particular field
|
||||
inventreePut("{% url 'api-part-detail' part.id %}",
|
||||
data,
|
||||
@ -235,50 +234,5 @@
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
$('#activate-part').click(function() {
|
||||
showQuestionDialog(
|
||||
'Activate Part?',
|
||||
'Are you sure you wish to reactivate {{ part.full_name }}?',
|
||||
{
|
||||
accept_text: 'Activate',
|
||||
accept: function() {
|
||||
inventreePut(
|
||||
"{% url 'api-part-detail' part.id %}",
|
||||
{
|
||||
active: true,
|
||||
},
|
||||
{
|
||||
method: 'PATCH',
|
||||
reloadOnSuccess: true,
|
||||
}
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
$('#deactivate-part').click(function() {
|
||||
showQuestionDialog(
|
||||
'Deactivate Part?',
|
||||
`Are you sure you wish to deactivate {{ part.full_name }}?<br>
|
||||
`,
|
||||
{
|
||||
accept_text: 'Deactivate',
|
||||
accept: function() {
|
||||
inventreePut(
|
||||
"{% url 'api-part-detail' part.id %}",
|
||||
{
|
||||
active: false,
|
||||
},
|
||||
{
|
||||
method: 'PATCH',
|
||||
reloadOnSuccess: true,
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user