mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-18 05:52: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) {
|
||||
$('#' + assetID).remove();
|
||||
}
|
||||
$('#modal').on('hidden.bs.modal', function (e) {
|
||||
searchbar = document.getElementById('id_q');
|
||||
searchbar.value = "";
|
||||
setTimeout(searchbar.focus(), 2000);
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</thead>
|
||||
<tbody id="asset_table_body">
|
||||
{% 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>
|
||||
<td class="assetDesc"><span class="text-truncate d-inline-block align-middle">{{ item.description }}</span></td>
|
||||
<td class="assetCategory align-middle">{{ item.category }}</td>
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
e.preventDefault();
|
||||
data = $(this).serialize();
|
||||
action = $(this).attr('action');
|
||||
console.log(action)
|
||||
$.post(action, data, function(resp) {
|
||||
$('#modal').html(resp);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user