OLD | NEW |
1 /* | 1 /* |
2 This file is part of the Juju GUI, which lets users view and manage Juju | 2 This file is part of the Juju GUI, which lets users view and manage Juju |
3 environments within a graphical interface (https://launchpad.net/juju-gui). | 3 environments within a graphical interface (https://launchpad.net/juju-gui). |
4 Copyright (C) 2012-2013 Canonical Ltd. | 4 Copyright (C) 2012-2013 Canonical Ltd. |
5 | 5 |
6 This program is free software: you can redistribute it and/or modify it under | 6 This program is free software: you can redistribute it and/or modify it under |
7 the terms of the GNU Affero General Public License version 3, as published by | 7 the terms of the GNU Affero General Public License version 3, as published by |
8 the Free Software Foundation. | 8 the Free Software Foundation. |
9 | 9 |
10 This program is distributed in the hope that it will be useful, but WITHOUT | 10 This program is distributed in the hope that it will be useful, but WITHOUT |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 _renderSearchWidget: function(node) { | 156 _renderSearchWidget: function(node) { |
157 // It only makes sense to render search if we have a store to use to | 157 // It only makes sense to render search if we have a store to use to |
158 // search against. | 158 // search against. |
159 if (this.get('store')) { | 159 if (this.get('store')) { |
160 var store = this.get('store'); | 160 var store = this.get('store'); |
161 this.search = new widgets.browser.Search({ | 161 this.search = new widgets.browser.Search({ |
162 autocompleteSource: Y.bind( | 162 autocompleteSource: Y.bind( |
163 store.autocomplete, | 163 store.autocomplete, |
164 store | 164 store |
165 ), | 165 ), |
166 autocompleteDataFormatter: store.resultsToCharmlist, | 166 autocompleteDataFormatter: store.transformResults, |
167 categoryIconGenerator: Y.bind(store.buildCategoryIconPath, store), | 167 categoryIconGenerator: Y.bind(store.buildCategoryIconPath, store), |
168 filters: this.get('filters'), | 168 filters: this.get('filters'), |
169 withHome: this.get('withHome') | 169 withHome: this.get('withHome') |
170 }); | 170 }); |
171 this.search.render(node.one('.bws-header')); | 171 this.search.render(node.one('.bws-header')); |
172 } | 172 } |
173 | 173 |
174 // Make sure the controls starts out setting the correct active state | 174 // Make sure the controls starts out setting the correct active state |
175 // based on the current viewmode for our View. | 175 // based on the current viewmode for our View. |
176 this.controls = new widgets.ViewmodeControls({ | 176 this.controls = new widgets.ViewmodeControls({ |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 'browser-search-widget', | 337 'browser-search-widget', |
338 'event-tracker', | 338 'event-tracker', |
339 'juju-charm-store', | 339 'juju-charm-store', |
340 'juju-browser-models', | 340 'juju-browser-models', |
341 'juju-models', | 341 'juju-models', |
342 'querystring-stringify', | 342 'querystring-stringify', |
343 'view', | 343 'view', |
344 'viewmode-controls' | 344 'viewmode-controls' |
345 ] | 345 ] |
346 }); | 346 }); |
OLD | NEW |