summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcsilv@chromium.org <csilv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-24 18:16:05 +0000
committercsilv@chromium.org <csilv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-24 18:16:05 +0000
commitc6ce4f6569569fb21745b698adc9ce4abb132980 (patch)
tree085eed84bea737e908047f29f54577c0cdedbac7
parentfabf529873f4cd782ec98980853365c161d65f48 (diff)
downloadchromium_src-c6ce4f6569569fb21745b698adc9ce4abb132980.zip
chromium_src-c6ce4f6569569fb21745b698adc9ce4abb132980.tar.gz
chromium_src-c6ce4f6569569fb21745b698adc9ce4abb132980.tar.bz2
[dom-ui settings] Fix search failure (regression).
BUG=87065 TEST=Verify search works properly. Review URL: http://codereview.chromium.org/7198019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90388 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/resources/options/options_page.css2
-rw-r--r--chrome/browser/resources/options/search_page.css2
-rw-r--r--chrome/browser/resources/options/search_page.js43
3 files changed, 28 insertions, 19 deletions
diff --git a/chrome/browser/resources/options/options_page.css b/chrome/browser/resources/options/options_page.css
index b6dcc0f..81edf81 100644
--- a/chrome/browser/resources/options/options_page.css
+++ b/chrome/browser/resources/options/options_page.css
@@ -770,7 +770,7 @@ html[flashPluginSupportsClearSiteData] .clear-plugin-lso-data-disabled {
}
/* do not display a border after the last section in the table */
-.displaytable > section:last-child > * {
+.displaytable:not([searching='true']) > section:last-child > * {
border-bottom: none;
}
diff --git a/chrome/browser/resources/options/search_page.css b/chrome/browser/resources/options/search_page.css
index b6e1b6a..942dd98 100644
--- a/chrome/browser/resources/options/search_page.css
+++ b/chrome/browser/resources/options/search_page.css
@@ -1,5 +1,5 @@
.search-hidden {
- display: none;
+ display: none !important;
}
.search-highlighted {
diff --git a/chrome/browser/resources/options/search_page.js b/chrome/browser/resources/options/search_page.js
index f6a88c8..db9b77e 100644
--- a/chrome/browser/resources/options/search_page.js
+++ b/chrome/browser/resources/options/search_page.js
@@ -226,7 +226,7 @@ cr.define('options', function() {
if (hash)
this.searchField.value = unescape(hash.slice(1));
} else {
- // Just wipe out any active search text since it's no longer relevant.
+ // Just wipe out any active search text since it's no longer relevant.
this.searchField.value = '';
}
@@ -241,11 +241,21 @@ cr.define('options', function() {
// sections (ie titles, button strips). We do this before changing
// the page visibility to avoid excessive re-draw.
for (var i = 0, childDiv; childDiv = page.pageDiv.children[i]; i++) {
- if (active) {
- if (childDiv.tagName != 'SECTION')
- childDiv.classList.add('search-hidden');
+ if (childDiv.classList.contains('displaytable')) {
+ childDiv.setAttribute('searching', active ? 'true' : 'false');
+ for (var j = 0, subDiv; subDiv = childDiv.children[j]; j++) {
+ if (active) {
+ if (subDiv.tagName != 'SECTION')
+ subDiv.classList.add('search-hidden');
+ } else {
+ subDiv.classList.remove('search-hidden');
+ }
+ }
} else {
- childDiv.classList.remove('search-hidden');
+ if (active)
+ childDiv.classList.add('search-hidden');
+ else
+ childDiv.classList.remove('search-hidden');
}
}
@@ -310,14 +320,12 @@ cr.define('options', function() {
}
if (pageMatch)
foundMatches = true;
- for (var i = 0, childDiv; childDiv = page.pageDiv.children[i]; i++) {
- if (childDiv.tagName == 'SECTION') {
- if (pageMatch) {
- childDiv.classList.remove('search-hidden');
- } else {
- childDiv.classList.add('search-hidden');
- }
- }
+ var elements = page.pageDiv.querySelectorAll('.displaytable > section');
+ for (var i = 0, node; node = elements[i]; i++) {
+ if (pageMatch)
+ node.classList.remove('search-hidden');
+ else
+ node.classList.add('search-hidden');
}
}
@@ -325,10 +333,11 @@ cr.define('options', function() {
// Search all top-level sections for anchored string matches.
for (var key in pagesToSearch) {
page = pagesToSearch[key];
- for (var i = 0, childDiv; childDiv = page.pageDiv.children[i]; i++) {
- if (childDiv.tagName == 'SECTION' &&
- this.performReplace_(regEx, replaceString, childDiv)) {
- childDiv.classList.remove('search-hidden');
+ var elements =
+ page.pageDiv.querySelectorAll('.displaytable > section');
+ for (var i = 0, node; node = elements[i]; i++) {
+ if (this.performReplace_(regEx, replaceString, node)) {
+ node.classList.remove('search-hidden');
foundMatches = true;
}
}