Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 'use strict'; | 1 'use strict'; |
2 | 2 |
3 | 3 |
4 /** * The widget used across Browser view to manage the search box and the | 4 /** |
rharding
2013/04/22 14:08:15
typo
j.c.sackett
2013/04/22 20:54:45
Fixed.
| |
5 * The widget used across Browser view to manage the search box and the | |
5 * controls for selecting which view you're in. | 6 * controls for selecting which view you're in. |
6 * | 7 * |
7 * @module widgets | 8 * @module widgets |
8 * @submodule browser | 9 * @submodule browser |
9 * | 10 * |
10 */ | 11 */ |
11 YUI.add('browser-search-widget', function(Y) { | 12 YUI.add('browser-search-widget', function(Y) { |
12 var ns = Y.namespace('juju.widgets.browser'), | 13 var ns = Y.namespace('juju.widgets.browser'), |
13 templates = Y.namespace('juju.views').Templates; | 14 templates = Y.namespace('juju.views').Templates; |
14 | 15 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 'submit', this._handleSubmit, this) | 92 'submit', this._handleSubmit, this) |
92 ); | 93 ); |
93 | 94 |
94 // Note that the search could be updated either from our internal input | 95 // Note that the search could be updated either from our internal input |
95 // control, or it could come from someone outside of the widget asking | 96 // control, or it could come from someone outside of the widget asking |
96 // it to update to a specific value. This is how things like clicking | 97 // it to update to a specific value. This is how things like clicking |
97 // categories can work. | 98 // categories can work. |
98 var input = container.one('input'); | 99 var input = container.one('input'); |
99 this.addEvent( | 100 this.addEvent( |
100 input.on('valueChange', function(ev) { | 101 input.on('valueChange', function(ev) { |
101 var val = ev.currentTarget.get('value'); | 102 this.set('text', ev.newVal); |
rharding
2013/04/22 14:08:15
I think on valueChange the new value is in the ev
j.c.sackett
2013/04/22 20:54:45
You're right; I've made the replacement.
| |
102 this.set('text', val); | |
103 this.fire(this.EVT_SEARCH_CHANGED); | 103 this.fire(this.EVT_SEARCH_CHANGED); |
104 }, this) | 104 }, this) |
105 ); | 105 ); |
106 }, | 106 }, |
107 | 107 |
108 /** | 108 /** |
109 * Clear the search input control in order to reset it. | 109 * Clear the search input control in order to reset it. |
110 * | 110 * |
111 * @method clearSearch | 111 * @method clearSearch |
112 * | 112 * |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
185 requires: [ | 185 requires: [ |
186 'base', | 186 'base', |
187 'event', | 187 'event', |
188 'event-tracker', | 188 'event-tracker', |
189 'event-valuechange', | 189 'event-valuechange', |
190 'juju-templates', | 190 'juju-templates', |
191 'juju-views', | 191 'juju-views', |
192 'widget' | 192 'widget' |
193 ] | 193 ] |
194 }); | 194 }); |
LEFT | RIGHT |