www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 8214d7ac60601aee27a4d5b59b1d3a8b18fb143e
parent 72b53e1b3ffc2297012e1d5732fca734e5b7d0a2
Author: Dan Stillman <dstillman@zotero.org>
Date:   Mon, 16 Jun 2008 15:11:59 +0000

Fix tag autocomplete

Also fixed to not display tags twice if both manual and automatic and to not display automatic tags if manual versions of the same tags are already linked to the current item



Diffstat:
Mcomponents/zotero-autocomplete.js | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/components/zotero-autocomplete.js b/components/zotero-autocomplete.js @@ -134,21 +134,21 @@ ZoteroAutoComplete.prototype.startSearch = function(searchString, searchParam, break; case 'tag': - var sql = "SELECT name FROM tags WHERE name LIKE ?"; + var sql = "SELECT DISTINCT name FROM tags WHERE name LIKE ?"; var sqlParams = [searchString + '%']; if (extra){ - sql += " AND tagID NOT IN (SELECT tagID FROM itemTags WHERE " - + "itemID = ?)"; + sql += " AND name NOT IN (SELECT name FROM tags WHERE tagID IN (" + + "SELECT tagID FROM itemTags WHERE itemID = ?))"; sqlParams.push(extra); } + var results = this._zotero.DB.columnQuery(sql, sqlParams); if (results) { - var collation = Zotero.getLocaleCollation(); + var collation = this._zotero.getLocaleCollation(); results.sort(function(a, b) { return collation.compareString(1, a, b); }); } - break; case 'creator':