mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-08 22:18:28 +03:00
Advanced search improvements (#32)
This commit is contained in:
parent
c8a5d45f37
commit
efeef4b143
19 changed files with 101 additions and 22 deletions
|
|
@ -15,7 +15,10 @@ function PopupsAdvancedSearchViewModel()
|
|||
this.subject = ko.observable('');
|
||||
this.text = ko.observable('');
|
||||
this.selectedDateValue = ko.observable(-1);
|
||||
|
||||
this.hasAttachments = ko.observable(false);
|
||||
this.starred = ko.observable(false);
|
||||
this.unseen = ko.observable(false);
|
||||
|
||||
this.searchCommand = Utils.createCommand(this, function () {
|
||||
|
||||
|
|
@ -50,7 +53,8 @@ PopupsAdvancedSearchViewModel.prototype.buildSearchString = function ()
|
|||
sFrom = Utils.trim(this.from()),
|
||||
sTo = Utils.trim(this.to()),
|
||||
sSubject = Utils.trim(this.subject()),
|
||||
sText = Utils.trim(this.text())
|
||||
sText = Utils.trim(this.text()),
|
||||
aHas = []
|
||||
;
|
||||
|
||||
if (sFrom && '' !== sFrom)
|
||||
|
|
@ -70,7 +74,22 @@ PopupsAdvancedSearchViewModel.prototype.buildSearchString = function ()
|
|||
|
||||
if (this.hasAttachments())
|
||||
{
|
||||
aResult.push('has:attachments');
|
||||
aHas.push('attachments');
|
||||
}
|
||||
|
||||
if (this.unseen())
|
||||
{
|
||||
aHas.push('unseen');
|
||||
}
|
||||
|
||||
if (this.starred())
|
||||
{
|
||||
aHas.push('flag');
|
||||
}
|
||||
|
||||
if (0 < aHas.length)
|
||||
{
|
||||
aResult.push('has:' + aHas.join(','));
|
||||
}
|
||||
|
||||
if (-1 < this.selectedDateValue())
|
||||
|
|
@ -95,6 +114,8 @@ PopupsAdvancedSearchViewModel.prototype.clearPopup = function ()
|
|||
|
||||
this.selectedDateValue(-1);
|
||||
this.hasAttachments(false);
|
||||
this.starred(false);
|
||||
this.unseen(false);
|
||||
|
||||
this.fromFocus(true);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue