diff options
author | Christopher Lenz <cmlenz@apache.org> | 2009-01-16 18:01:33 +0000 |
---|---|---|
committer | Christopher Lenz <cmlenz@apache.org> | 2009-01-16 18:01:33 +0000 |
commit | 4c921ff6730e63a17c5be5b5ac01da44818833a4 (patch) | |
tree | ebe20333ea267b7904c1b58ea140bd5dc9703b1f /share/www/script/futon.browse.js | |
parent | 4bd235f6ddcce66a6f0cba753702ff6f47088ccb (diff) |
Fix for autocompletion in "Save as" dialog in Futon to work with the changed `_all_docs` collation.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@735071 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/futon.browse.js')
-rw-r--r-- | share/www/script/futon.browse.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/share/www/script/futon.browse.js b/share/www/script/futon.browse.js index cdd3a41e..9e8aba66 100644 --- a/share/www/script/futon.browse.js +++ b/share/www/script/futon.browse.js @@ -331,12 +331,14 @@ load: function(elem) { $("#input_docid", elem).val(designDocId).suggest(function(text, callback) { db.allDocs({ - limit: 10, startkey: "_design/" + text, - endkey: "_design/" + text + "ZZZZ", + limit: 10, startkey: "_design/" + text, endkey: "_design0", success: function(docs) { var matches = []; for (var i = 0; i < docs.rows.length; i++) { - matches[i] = docs.rows[i].id.substr(8); + var docName = docs.rows[i].id.substr(8); + if (docName.substr(0, text.length) == text) { + matches[i] = docName; + } } callback(matches); } @@ -349,10 +351,9 @@ var matches = []; if (!doc.views) return; for (var viewName in doc.views) { - if (!doc.views.hasOwnProperty(viewName) || !viewName.match("^" + text)) { - continue; + if (viewName.substr(0, text.length) == text) { + matches.push(viewName); } - matches.push(viewName); } callback(matches); } |