]> git.ozlabs.org Git - patchwork/blob - htdocs/js/autocomplete.js
115ffba88ff68788d5ccd1f75449481d9716b82a
[patchwork] / htdocs / js / autocomplete.js
1
2
3 function ac_keyup(input)
4 {
5         input.autocomplete.keyup();
6 }
7
8 function AutoComplete(input)
9 {
10         this.input = input;
11         this.div = null;
12         this.last_value = '';
13
14         input.autocomplete = this;
15
16         this.hide = function()
17         {
18                 if (this.div) {
19                         this.div.style.display = 'none';
20                         this.div = null;
21                 }
22
23         }
24
25         this.show = function()
26         {
27                 if (!this.div) {
28                         this.div = 
29
30         this.keyup = function()
31         {
32                 value = input.value;
33
34                 if (value == this.last_value)
35                         return;
36
37                 if (value.length < 3) {
38                         this.hide();
39                 }
40
41
42 }
43