6
6
var searchbars = Y.all('.ues-searchbar');
8
if (searchbars.size()) {
9
searchbars.each(function(node, i) {
11
// input which has autocomplete plugin
13
// autocomplete boundingbox
16
input = node.one('input[type="search"]');
18
throw new Error('autocomplete is missing input');
22
input.plug(Y.Plugin.AutoComplete, {
23
resultTextLocator: 'text',
24
resultHighlighter: 'phraseMatch',
29
autoCompleteBox = input.ac.get('boundingBox');
30
autoCompleteBox.addClass('ues-autocomplete').addClass('ues-dropdown');
31
autoCompleteBox.one('ul').addClass('ues-dropdown-menu');
32
autoCompleteBox.setStyle('width', '100%');
34
// make ac control the visibility of the ues-dropdown
35
input.ac.before('visibleChange', function (e) {
36
autoCompleteBox.toggleClass('open', e.newVal);
8
searchbars.each(function (node, i) {
10
// input which has autocomplete plugin
12
// autocomplete boundingbox
15
input = node.one('input[type="search"]');
17
throw new Error('autocomplete is missing input');
21
input.plug(Y.Plugin.AutoComplete, {
22
resultTextLocator: 'text',
23
resultHighlighter: 'phraseMatch',
28
autoCompleteBox = input.ac.get('boundingBox');
29
autoCompleteBox.addClass('ues-autocomplete').addClass('ues-dropdown');
30
autoCompleteBox.one('ul').addClass('ues-dropdown-menu');
31
autoCompleteBox.setStyle('width', '100%');
33
// make ac control the visibility of the ues-dropdown
34
input.ac.before('visibleChange', function (e) {
35
autoCompleteBox.toggleClass('open', e.newVal);