MDL-61899 tool_dataprivacy: Fixes during integration review
[moodle.git] / lib / yuilib / 3.17.2 / autocomplete-plugin / autocomplete-plugin.js
blob44829e039b8bc305d913afd6a600673050cc8c92
1 /*
2 YUI 3.17.2 (build 9c3c78e)
3 Copyright 2014 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
6 */
8 YUI.add('autocomplete-plugin', function (Y, NAME) {
10 /**
11 Binds an AutoCompleteList instance to a Node instance.
13 @module autocomplete
14 @submodule autocomplete-plugin
15 **/
17 /**
18 Binds an AutoCompleteList instance to a Node instance.
20 @example
22     Y.one('#my-input').plug(Y.Plugin.AutoComplete, {
23         source: 'select * from search.suggest where query="{query}"'
24     });
26     // You can now access the AutoCompleteList instance at Y.one('#my-input').ac
28 @class Plugin.AutoComplete
29 @extends AutoCompleteList
30 **/
32 var Plugin = Y.Plugin;
34 function ACListPlugin(config) {
35     config.inputNode = config.host;
37     // Render by default.
38     if (!config.render && config.render !== false) {
39       config.render = true;
40     }
42     ACListPlugin.superclass.constructor.apply(this, arguments);
45 Y.extend(ACListPlugin, Y.AutoCompleteList, {}, {
46     NAME      : 'autocompleteListPlugin',
47     NS        : 'ac',
48     CSS_PREFIX: Y.ClassNameManager.getClassName('aclist')
49 });
51 Plugin.AutoComplete     = ACListPlugin;
52 Plugin.AutoCompleteList = ACListPlugin;
55 }, '3.17.2', {"requires": ["autocomplete-list", "node-pluginhost"]});