File tree 1 file changed +4
-9
lines changed
1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change 36
36
<input type =" text" id =" search" autocomplete =" off" autofocus />
37
37
38
38
{% for name , package in packages %}
39
+ <div >
39
40
<h3 id =" {{ package .highest .name }}" >{{ package .highest .name }}</h3 >
40
41
{% if package .highest .description %}
41
42
<p >{{ package .highest .description }}</p >
95
96
</td >
96
97
</tr >
97
98
</table >
99
+ </div >
98
100
{% endfor %}
99
101
</div >
100
102
</div >
107
109
{% include ' jquery-2.0.0.js' %}
108
110
{% include ' moment-2.4.0.js' %}
109
111
$ (function (){
110
- var packages = $ (' h3' ).each (function (){
111
- var desc = $ (this ).next (' p' ),
112
- info = desc .length ? desc .next (' table' ) : $ (this ).next (' table' );
113
- $ (this ).data (' desc' , desc);
114
- $ (this ).data (' info' , info);
115
- });
112
+ var packages = $ (' h3' );
116
113
var timer;
117
114
$ (' input#search' ).keyup (function (){
118
115
clearTimeout (timer);
121
118
timer = setTimeout (function () {
122
119
packages .each (function (){
123
120
show = $ (this ).text ().toLowerCase ().indexOf (needle) != - 1 ;
124
- $ (this ).toggle (show);
125
- $ (this ).data (' desc' ).toggle (show);
126
- $ (this ).data (' info' ).toggle (show);
121
+ $ (this ).parent ().toggle (show);
127
122
});
128
123
}, ms);
129
124
}).focus ();
You can’t perform that action at this time.
0 commit comments