Fix tag population and date formatting
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{% load static %}
|
||||
{% load index %}
|
||||
{% load joinsep %}
|
||||
{% include 'partials/notify.html' %}
|
||||
{% if table %}
|
||||
<div style="display: none" id="jsonData" data-json="{{ data }}">
|
||||
@@ -35,4 +36,24 @@
|
||||
{% include 'ui/drilldown/table_results_partial.html' %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{# Update the tags in case the user changed the query #}
|
||||
{# Check for focus and refocus #}
|
||||
<script>
|
||||
var inputTags = document.getElementsByClassName('tags-input');
|
||||
var inputBox = document.querySelector("[placeholder='Add query']");
|
||||
var isFocused = (document.activeElement === inputBox);
|
||||
for (index = 0; index < inputTags.length; index++) {
|
||||
if (index == 0) {
|
||||
inputTags[0].outerHTML = '<input id="tags" class="input" type="tags" placeholder="Add query" value="{{ tags|joinsep:',' }}">';
|
||||
} else {
|
||||
inputTags[index].remove();
|
||||
}
|
||||
}
|
||||
// inputTags[0].outerHTML = '<input id="tags" class="input" type="tags" placeholder="Add query" value="{{ tags|joinsep:',' }}">';
|
||||
setupTags();
|
||||
var inputBox = document.querySelector("[placeholder='Add query']");
|
||||
if (isFocused) {
|
||||
inputBox.focus();
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user