]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - jssource/src_files/include/javascript/yui3/build/autocomplete/autocomplete-plugin.js
Release 6.5.0
[Github/sugarcrm.git] / jssource / src_files / include / javascript / yui3 / build / autocomplete / autocomplete-plugin.js
1 /*
2 Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3 Code licensed under the BSD License:
4 http://developer.yahoo.com/yui/license.html
5 version: 3.3.0
6 build: 3167
7 */
8 YUI.add('autocomplete-plugin', function(Y) {
9
10 /**
11  * Binds an AutoCompleteList instance to a Node instance.
12  *
13  * @module autocomplete
14  * @submodule autocomplete-plugin
15  */
16
17 /**
18  * <p>
19  * Binds an AutoCompleteList instance to a Node instance.
20  * </p>
21  *
22  * <p>
23  * Example:
24  * </p>
25  *
26  * <pre>
27  * Y.one('#my-input').plug(Y.Plugin.AutoComplete, {
28  * &nbsp;&nbsp;source: 'select * from search.suggest where query="{query}"'
29  * });
30  * &nbsp;
31  * // You can now access the AutoCompleteList instance at Y.one('#my-input').ac
32  * </pre>
33  *
34  * @class Plugin.AutoComplete
35  * @extends AutoCompleteList
36  */
37
38 var Plugin = Y.Plugin;
39
40 function ACListPlugin(config) {
41     config.inputNode = config.host;
42
43     // Render by default.
44     if (!config.render && config.render !== false) {
45       config.render = true;
46     }
47
48     ACListPlugin.superclass.constructor.apply(this, arguments);
49 }
50
51 Y.extend(ACListPlugin, Y.AutoCompleteList, {}, {
52     NAME      : 'autocompleteListPlugin',
53     NS        : 'ac',
54     CSS_PREFIX: Y.ClassNameManager.getClassName('aclist')
55 });
56
57 Plugin.AutoComplete     = ACListPlugin;
58 Plugin.AutoCompleteList = ACListPlugin;
59
60
61 }, '3.3.0' ,{requires:['autocomplete-list', 'node-pluginhost']});