1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

rearrange search functionality

This commit is contained in:
catborise 2021-06-10 15:17:53 +03:00 committed by catborise
parent a47d006771
commit d7c0f9445d
10 changed files with 31 additions and 80 deletions

View file

@ -8,9 +8,7 @@
{% block page_heading_extra %}
{% include 'create_nwfilter_block.html' %}
<div class="float-right search">
<input id="filter" class="form-control" type="text" placeholder="{% trans 'Search' %}">
</div>
{% include 'search_block.html' %}
{% endblock page_heading_extra %}
{% block content %}
@ -142,24 +140,11 @@
{% endblock %}
{% block script %}
<script src="{% static "js/sortable.min.js" %}"></script>
<script src="{% static 'js/sortable.min.js' %}"></script>
<script src="{% static 'js/filter-table.js' %}"></script>
<script src="{% static 'js/ace/ace.js' %}"></script>
<script>
$(document).ready(function () {
(function ($) {
$('#filter').keyup(function () {
var rex = new RegExp($(this).val(), 'i');
$('.searchable tr').hide();
$('.searchable tr').filter(function () {
return rex.test($(this).text());
}).show();
})
}(jQuery));
});
</script>
<script src="{% static "js/ace/ace.js" %}"></script>
<script>
var editor = ace.edit("editor");
var editor = ace.edit("editor");
editor.getSession().setMode("ace/mode/xml");
var input = $('input[name="nwfilter_xml"]');