Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(67)

Unified Diff: app/subapps/browser/views/view.js

Issue 8910043: Adds search functionality
Patch Set: Adds search functionality Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « app/subapps/browser/views/search.js ('k') | app/templates/browser-search.handlebars » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/subapps/browser/views/view.js
=== modified file 'app/subapps/browser/views/view.js'
--- app/subapps/browser/views/view.js 2013-04-16 23:39:54 +0000
+++ app/subapps/browser/views/view.js 2013-04-22 16:11:04 +0000
@@ -107,7 +107,17 @@
*
*/
_searchChanged: function(ev) {
- console.log('search changed.');
+ // NB: This is temporary; eventually filtering will include categories,
+ // and the Filter object will handle qs generation. But it's an unwieldy
+ // url to parse while we only support text search.
+ var qs = Y.QueryString.stringify({text: ev.details[0]});
+ var change = {
+ search: true,
+ querystring: qs
+ };
+ this.fire('viewNavigate', {
+ change: change
+ });
},
/**
@@ -151,31 +161,6 @@
},
/**
- * Shared method to generate a message to the user based on a bad api
- * call.
- *
- * @method apiFailure
- * @param {Object} data the json decoded response text.
- * @param {Object} request the original io_request object for debugging.
- *
- */
- apiFailure: function(data, request) {
- var message;
- if (data && data.type) {
- message = 'Charm API error of type: ' + data.type;
- } else {
- message = 'Charm API server did not respond';
- }
- this.get('db').notifications.add(
- new models.Notification({
- title: 'Failed to load sidebar content.',
- message: message,
- level: 'error'
- })
- );
- },
-
- /**
* Destroy this view and clear from the dom world.
*
* @method destructor
@@ -269,6 +254,7 @@
'event-tracker',
'juju-charm-store',
'juju-models',
+ 'querystring-stringify',
'view'
]
});
« no previous file with comments | « app/subapps/browser/views/search.js ('k') | app/templates/browser-search.handlebars » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b