www

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

commit 9f573794153513a4ffa49eba0d1392444878f241
parent f8739ee6c5f7bdb8cdeb96308ed6bf71ff5bccfc
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue,  8 Aug 2006 15:40:42 +0000

Make searchConditionIDs a little easier to work with--now accessible by with the .id property of search conditions in addition to index


Diffstat:
Mchrome/chromeFiles/content/scholar/xpcom/search.js | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/chrome/chromeFiles/content/scholar/xpcom/search.js b/chrome/chromeFiles/content/scholar/xpcom/search.js @@ -47,6 +47,7 @@ Scholar.Search.prototype.load = function(savedSearchID){ for (var i in conditions){ this._conditions[conditions[i]['searchConditionID']] = { + id: conditions[i]['searchConditionID'], condition: conditions[i]['condition'], operator: conditions[i]['operator'], value: conditions[i]['value'] @@ -111,6 +112,7 @@ Scholar.Search.prototype.addCondition = function(condition, operator, value){ var searchConditionID = this._maxSearchConditionID++; this._conditions[searchConditionID] = { + id: searchConditionID, condition: condition, operator: operator, value: value @@ -132,6 +134,7 @@ Scholar.Search.prototype.updateCondition = function(searchConditionID, condition } this._conditions[searchConditionID] = { + id: searchConditionID, condition: condition, operator: operator, value: value @@ -152,6 +155,7 @@ Scholar.Search.prototype.removeCondition = function(searchConditionID){ var i = searchConditionID + 1; while (typeof this._conditions[i] != 'undefined'){ this._conditions[i-1] = this._conditions[i]; + this._conditions[i-1]['id']--; delete this._conditions[i]; i++; }