Permalink
Browse files

Corrected search for tags that are substrings of others.

Example is "java" and "javascript"
  • Loading branch information...
pelegri committed Aug 14, 2012
1 parent 5050811 commit ce56849d3d40d71dca651bb437e970381b415d44
Showing with 5 additions and 3 deletions.
  1. BIN css/icon-down.png
  2. BIN css/icon-right.png
  3. +5 −3 js/All_Samples.js
View
Binary file not shown.
View
Binary file not shown.
View
@@ -169,6 +169,7 @@ function parseRepoData(data,
}
+ // list of tags is ","-separated with additional "," at front and back
items.push('<tr class="samplerow" tags=",'+val.tags.join(",")+',">' +
/* Start Row */
@@ -180,7 +181,7 @@ function parseRepoData(data,
/* Description */
'<td>' + val.desc +
( showTagsData
- ? ' <span class="question" left="yes" tip="' + val.tags.join(", ") + '">T</span>'
+ ? ' <span class="question" left="yes" tip=",' + val.tags.join(", ") + ',">T</span>'
: ''
) +
( ( val.note )
@@ -296,8 +297,9 @@ $(document).ready(function(){
// show rows with the tag
$('tr.samplerow').each(function(){
- var tags = $(this).attr("tags")
- if (tags.indexOf(tag) >= 0) {
+
+ // TagList is ","-separated with an extra "," at front and another at end
+ if ( $(this).attr("tags").indexOf(","+tag+",") >= 0 ) {
$(this).show(); // the row...
$(this).parents("div.dynContent").each(function(){
$(this).show(); // ... and the DIV it belongs to

0 comments on commit ce56849

Please sign in to comment.