|
1 /* |
|
2 YUI 3.10.3 (build 2fb5187) |
|
3 Copyright 2013 Yahoo! Inc. All rights reserved. |
|
4 Licensed under the BSD License. |
|
5 http://yuilibrary.com/license/ |
|
6 */ |
|
7 |
|
8 YUI.add('autocomplete-plugin', function (Y, NAME) { |
|
9 |
|
10 /** |
|
11 Binds an AutoCompleteList instance to a Node instance. |
|
12 |
|
13 @module autocomplete |
|
14 @submodule autocomplete-plugin |
|
15 **/ |
|
16 |
|
17 /** |
|
18 Binds an AutoCompleteList instance to a Node instance. |
|
19 |
|
20 @example |
|
21 |
|
22 Y.one('#my-input').plug(Y.Plugin.AutoComplete, { |
|
23 source: 'select * from search.suggest where query="{query}"' |
|
24 }); |
|
25 |
|
26 // You can now access the AutoCompleteList instance at Y.one('#my-input').ac |
|
27 |
|
28 @class Plugin.AutoComplete |
|
29 @extends AutoCompleteList |
|
30 **/ |
|
31 |
|
32 var Plugin = Y.Plugin; |
|
33 |
|
34 function ACListPlugin(config) { |
|
35 config.inputNode = config.host; |
|
36 |
|
37 // Render by default. |
|
38 if (!config.render && config.render !== false) { |
|
39 config.render = true; |
|
40 } |
|
41 |
|
42 ACListPlugin.superclass.constructor.apply(this, arguments); |
|
43 } |
|
44 |
|
45 Y.extend(ACListPlugin, Y.AutoCompleteList, {}, { |
|
46 NAME : 'autocompleteListPlugin', |
|
47 NS : 'ac', |
|
48 CSS_PREFIX: Y.ClassNameManager.getClassName('aclist') |
|
49 }); |
|
50 |
|
51 Plugin.AutoComplete = ACListPlugin; |
|
52 Plugin.AutoCompleteList = ACListPlugin; |
|
53 |
|
54 |
|
55 }, '3.10.3', {"requires": ["autocomplete-list", "node-pluginhost"]}); |