Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Unified Diff: chrome/browser/resources/options/extension_list.js

Issue 8353022: [web-ui settings] Fixes and improvements for settings page searching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Rebase for commit queue Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/options/extension_settings.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/extension_list.js
===================================================================
--- chrome/browser/resources/options/extension_list.js (revision 107010)
+++ chrome/browser/resources/options/extension_list.js (working copy)
@@ -61,10 +61,9 @@
// Instal global event handlers.
if (!handlersInstalled) {
- this.ownerDocument.addEventListener('keyup',
- this.upEventHandler_.bind(this));
- this.ownerDocument.addEventListener('mouseup',
- this.upEventHandler_.bind(this));
+ var searchPage = SearchPage.getInstance();
+ searchPage.addEventListener('searchChanged',
+ this.searchChangedHandler_.bind(this));
// Support full keyboard accessibility without making things ugly
// for users who click, by hiding some focus outlines when the user
@@ -648,18 +647,18 @@
},
/**
- * Handles the mouse-up and keyboard-up events. This is used to limit the
- * number of items to show in the list, when the user is searching for items
- * with the search box. Otherwise, if one match is found, the whole list of
+ * Handles the 'searchChanged' event. This is used to limit the number of
+ * items to show in the list, when the user is searching for items with the
+ * search box. Otherwise, if one match is found, the whole list of
* extensions would be shown when we only want the matching items to be
* found.
* @param {Event} e Change event.
* @private
*/
- upEventHandler_: function(e) {
- var searchString = $('search-field').value.toLowerCase();
+ searchChangedHandler_: function(e) {
+ var searchString = e.searchText;
var child = this.firstChild;
- while (child){
+ while (child) {
var extension = this.getExtensionWithId_(child.id);
if (searchString.length == 0) {
// Show all.
« no previous file with comments | « no previous file | chrome/browser/resources/options/extension_settings.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698