~ubuntu-branches/ubuntu/utopic/moodle/utopic

« back to all changes in this revision

Viewing changes to lib/yuilib/3.13.0/autocomplete-plugin/autocomplete-plugin.js

  • Committer: Package Import Robot
  • Author(s): Thijs Kinkhorst
  • Date: 2014-05-12 16:10:38 UTC
  • mfrom: (36.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20140512161038-puyqf65k4e0s8ytz
Tags: 2.6.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
YUI 3.13.0 (build 508226d)
 
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.13.0', {"requires": ["autocomplete-list", "node-pluginhost"]});