Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

followup fix to bugs from #298 #300

Merged
merged 2 commits into from

1 participant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 27, 2013
  1. @mikemorris

    followup fix to bugs from #298

    mikemorris authored
  2. @mikemorris

    removing console.log

    mikemorris authored
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 2 deletions.
  1. +7 −2 _includes/model.js
View
9 _includes/model.js
@@ -164,7 +164,12 @@ function getFiles(tree, path, searchstr) {
var pathMatches = 0;
function matchesPath(file) {
if (file.path === path) return false; // skip current path
- var match = file.path.match(new RegExp("^"+path+"/(.*)$"));
+ var length = path.length;
+ // Append trailing slash if path exists and not already present
+ if (length && path[length - 1] !== '/') {
+ path += '/';
+ }
+ var match = file.path.match(new RegExp("^"+path+"(.*)$"));
if (match) {
return !!searchstr || match[1].split('/').length <= (path ? 2 : 1);
}
@@ -189,7 +194,7 @@ function getFiles(tree, path, searchstr) {
// Mark match if searchstr not empty
if (searchstr.length) {
- file.name = file.name.replace(matchSearch, "<b>$1</b>");
+ file.name = file.name.replace(matchSearch, "<strong>$1</strong>");
}
if (!matchesPath(file)) return false;
Something went wrong with that request. Please try again.