123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- /*
- YUI 3.4.1 (build 4118)
- Copyright 2011 Yahoo! Inc. All rights reserved.
- Licensed under the BSD License.
- http://yuilibrary.com/license/
- */
- YUI.add('autocomplete-plugin', function(Y) {
- /**
- * Binds an AutoCompleteList instance to a Node instance.
- *
- * @module autocomplete
- * @submodule autocomplete-plugin
- */
- /**
- * <p>
- * Binds an AutoCompleteList instance to a Node instance.
- * </p>
- *
- * <p>
- * Example:
- * </p>
- *
- * <pre>
- * Y.one('#my-input').plug(Y.Plugin.AutoComplete, {
- * source: 'select * from search.suggest where query="{query}"'
- * });
- *
- * // You can now access the AutoCompleteList instance at Y.one('#my-input').ac
- * </pre>
- *
- * @class Plugin.AutoComplete
- * @extends AutoCompleteList
- */
- var Plugin = Y.Plugin;
- function ACListPlugin(config) {
- config.inputNode = config.host;
- // Render by default.
- if (!config.render && config.render !== false) {
- config.render = true;
- }
- ACListPlugin.superclass.constructor.apply(this, arguments);
- }
- Y.extend(ACListPlugin, Y.AutoCompleteList, {}, {
- NAME : 'autocompleteListPlugin',
- NS : 'ac',
- CSS_PREFIX: Y.ClassNameManager.getClassName('aclist')
- });
- Plugin.AutoComplete = ACListPlugin;
- Plugin.AutoCompleteList = ACListPlugin;
- }, '3.4.1' ,{requires:['autocomplete-list', 'node-pluginhost']});
|