From 9f573794153513a4ffa49eba0d1392444878f241 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 8 Aug 2006 15:40:42 +0000 Subject: [PATCH] Make searchConditionIDs a little easier to work with--now accessible by with the .id property of search conditions in addition to index --- chrome/chromeFiles/content/scholar/xpcom/search.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chrome/chromeFiles/content/scholar/xpcom/search.js b/chrome/chromeFiles/content/scholar/xpcom/search.js index c160841630..85f419dbda 100644 --- 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++; }