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

Unified Diff: chrome/common/extensions/docs/static/js/samples.js

Issue 23526077: [DocServer] Fixed Sample Links (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Python exception error and removed onLoad JS code Created 7 years, 3 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
Index: chrome/common/extensions/docs/static/js/samples.js
diff --git a/chrome/common/extensions/docs/static/js/samples.js b/chrome/common/extensions/docs/static/js/samples.js
index 6388205733b3ab368ca2e94556200a7eb642afce..66da941f3bb80042bf9f9578ba7000ae1bfc1746 100644
--- a/chrome/common/extensions/docs/static/js/samples.js
+++ b/chrome/common/extensions/docs/static/js/samples.js
@@ -9,8 +9,10 @@
function filterSamples() {
var search_text = search_box.value.toLowerCase();
for (var i = 0; i < samples.length; ++i) {
- var sample = samples[i]
- if (sample.getAttribute('tags').toLowerCase().indexOf(search_text) < 0)
+ var sample = samples[i];
+ var sample_title = samples[i].getElementsByTagName('h2')[0].innerText;
not at google - send to devlin 2013/09/24 18:16:30 nice, I like it. nits: - s/sample_title/sampleTitl
François Beaufort 2013/09/25 10:10:30 Done.
+ if (sample.getAttribute('tags').toLowerCase().indexOf(search_text) < 0 &&
+ sample_title.toLowerCase().indexOf(search_text) < 0)
sample.style.display = 'none';
else
sample.style.display = '';

Powered by Google App Engine
This is Rietveld 408576698