mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-23 16:32:15 +00:00
Automagically clear and focus ID field when audit modal closes
Closes #533
This commit is contained in:
@@ -35,6 +35,11 @@
|
|||||||
function onAuditClick(assetID) {
|
function onAuditClick(assetID) {
|
||||||
$('#' + assetID).remove();
|
$('#' + assetID).remove();
|
||||||
}
|
}
|
||||||
|
$('#modal').on('hidden.bs.modal', function (e) {
|
||||||
|
searchbar = document.getElementById('id_q');
|
||||||
|
searchbar.value = "";
|
||||||
|
setTimeout(searchbar.focus(), 2000);
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody id="asset_table_body">
|
<tbody id="asset_table_body">
|
||||||
{% for item in object_list %}
|
{% for item in object_list %}
|
||||||
<tr class="table-{{ item.status.display_class|default:'' }} assetRow">
|
<tr class="table-{{ item.status.display_class|default:'' }} assetRow" id="{{ item.asset_id }}">
|
||||||
<th scope="row" class="align-middle"><a class="assetID" href="{% url 'asset_detail' item.asset_id %}">{{ item.asset_id }}</a></th>
|
<th scope="row" class="align-middle"><a class="assetID" href="{% url 'asset_detail' item.asset_id %}">{{ item.asset_id }}</a></th>
|
||||||
<td class="assetDesc"><span class="text-truncate d-inline-block align-middle">{{ item.description }}</span></td>
|
<td class="assetDesc"><span class="text-truncate d-inline-block align-middle">{{ item.description }}</span></td>
|
||||||
<td class="assetCategory align-middle">{{ item.category }}</td>
|
<td class="assetCategory align-middle">{{ item.category }}</td>
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
data = $(this).serialize();
|
data = $(this).serialize();
|
||||||
action = $(this).attr('action');
|
action = $(this).attr('action');
|
||||||
console.log(action)
|
|
||||||
$.post(action, data, function(resp) {
|
$.post(action, data, function(resp) {
|
||||||
$('#modal').html(resp);
|
$('#modal').html(resp);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user