From 5bb1233d1890f512af57e0fa430d565d1788a234 Mon Sep 17 00:00:00 2001 From: "mscott%netscape.com" Date: Fri, 3 May 2002 21:58:10 +0000 Subject: [PATCH] Bug #136949 --> when creating a new search or filter row, clone the search attribute from the previous row. r=ssu sr=sspitzer --- .../search/resources/content/searchTermOverlay.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mailnews/base/search/resources/content/searchTermOverlay.js b/mailnews/base/search/resources/content/searchTermOverlay.js index 713c2198d369..f5a9b5c75e39 100644 --- a/mailnews/base/search/resources/content/searchTermOverlay.js +++ b/mailnews/base/search/resources/content/searchTermOverlay.js @@ -141,6 +141,7 @@ searchTermContainer.prototype = { save: function () { var searchTerm = this.searchTerm; + searchTerm.attrib = this.searchattribute.value; var nsMsgSearchAttrib = Components.interfaces.nsMsgSearchAttrib; if (this.searchattribute.value > nsMsgSearchAttrib.OtherHeader && this.searchattribute.value < nsMsgSearchAttrib.kNumMsgSearchAttributes) @@ -322,7 +323,15 @@ function initializeTermFromIndex(index) // we'll initialize the .booleanAnd from the existing setting in // the UI else - searchTermObj.booleanAnd = getBooleanAnd(); + { + searchTermObj.booleanAnd = getBooleanAnd(); + if (index) + { + // if we weren't pre-initialized with a searchTerm then steal the search attribute from the + // previous row. + searchTermObj.searchattribute.value = gSearchTerms[index - 1].obj.searchattribute.value; + } + } gSearchTerms[index].initialized = true; }