Fix filter-list behavior with a class flag
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
$ = jQuery
|
||||
$ ->
|
||||
$('input.filter-list').parent('div').removeClass('hide')
|
||||
$("input.filter-list").on "keyup", (e) ->
|
||||
rex = new RegExp($(this).val(), "i")
|
||||
|
||||
$(".searchable li").hide()
|
||||
$(".searchable li").parent().parent().hide()
|
||||
$(".searchable li").parent().parent('.list_hide_segment').hide()
|
||||
$(".searchable li").filter( ->
|
||||
rex.test $(this).text()
|
||||
).show()
|
||||
|
||||
@@ -4,15 +4,11 @@
|
||||
|
||||
$ = jQuery;
|
||||
|
||||
$(function() {});
|
||||
|
||||
$('input.filter-list').parent('div').removeClass('hide');
|
||||
|
||||
$("input.filter-list").on("keyup", function(e) {
|
||||
var ev, rex;
|
||||
rex = new RegExp($(this).val(), "i");
|
||||
$(".searchable li").hide();
|
||||
$(".searchable li").parent().parent().hide();
|
||||
$(".searchable li").parent().parent('.list_hide_segment').hide();
|
||||
$(".searchable li").filter(function() {
|
||||
return rex.test($(this).text());
|
||||
}).show();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% block content %}
|
||||
<div class="ui fluid icon input hide" style="margin-bottom:20px">
|
||||
<div class="ui fluid icon input" style="margin-bottom:20px">
|
||||
<input autofocus="autofocus" class="filter-list" placeholder="Type here to filter...">
|
||||
</div>
|
||||
<div class="ui searchable stackable doubling four column grid factlist">
|
||||
@@ -8,7 +8,7 @@
|
||||
{%- set facts_count = 0 -%}
|
||||
{%- set break = facts_len//4 + 1 -%}
|
||||
{%- for key,facts_list in facts_dict %}
|
||||
<div class="ui segment">
|
||||
<div class="ui list_hide_segment segment">
|
||||
<a class="ui darkblue ribbon label">{{key}}</a>
|
||||
<ul>
|
||||
{%- for fact in facts_list %}
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% block content %}
|
||||
<h1>Metrics</h1>
|
||||
<div class="ui fluid icon input hide" style="margin-bottom:20px">
|
||||
<input autofocus="autofocus" class="filter-table" placeholder="Type here to filter...">
|
||||
<div class="ui fluid icon input" style="margin-bottom:20px">
|
||||
<input autofocus="autofocus" class="filter-list" placeholder="Type here to filter...">
|
||||
</div>
|
||||
<table class='ui very compact very basic sortable table'>
|
||||
<thead>
|
||||
<tr>Metric</tr>
|
||||
</thead>
|
||||
<tbody class="searchable">
|
||||
<ul class="ui list searchable">
|
||||
{% for metric in metrics %}
|
||||
<tr>
|
||||
<td><a href="{{url_for('metric', env=current_env, metric=metric)}}">{{metric}}</a></td>
|
||||
</tr>
|
||||
<li>
|
||||
<a href="{{url_for('metric', env=current_env, metric=metric)}}">{{metric}}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</ul>
|
||||
{% endblock content %}
|
||||
|
||||
Reference in New Issue
Block a user