mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 15:45:55 +08:00
Fix search builder
This commit is contained in:
parent
68890f8083
commit
3217303a65
|
@ -31,7 +31,7 @@ export function momentNowUnix()
|
|||
*/
|
||||
export function searchSubtractFormatDateHelper(date)
|
||||
{
|
||||
momentNow().clone().subtract('days', date).format('YYYY.MM.DD');
|
||||
return momentNow().clone().subtract('days', date).format('YYYY.MM.DD');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -66,6 +66,28 @@
|
|||
kn.extendAsViewModel(['View/Popup/AdvancedSearch', 'PopupsAdvancedSearchViewModel'], AdvancedSearchPopupView);
|
||||
_.extend(AdvancedSearchPopupView.prototype, AbstractView.prototype);
|
||||
|
||||
AdvancedSearchPopupView.prototype.parseSearchStringValue = function (search)
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
parts = (search || '').split(/[\s]+/g)
|
||||
;
|
||||
|
||||
_.each(parts, function(part){
|
||||
switch (part)
|
||||
{
|
||||
case 'has:attachment':
|
||||
self.hasAttachment(true);
|
||||
break;
|
||||
case 'is:unseen,flagged':
|
||||
self.starred(true);
|
||||
case 'is:unseen':
|
||||
self.unseen(true);
|
||||
break;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
AdvancedSearchPopupView.prototype.buildSearchStringValue = function (sValue)
|
||||
{
|
||||
if (-1 < sValue.indexOf(' '))
|
||||
|
@ -156,9 +178,10 @@
|
|||
this.fromFocus(true);
|
||||
};
|
||||
|
||||
AdvancedSearchPopupView.prototype.onShow = function ()
|
||||
AdvancedSearchPopupView.prototype.onShow = function (search)
|
||||
{
|
||||
this.clearPopup();
|
||||
this.parseSearchStringValue(search);
|
||||
};
|
||||
|
||||
AdvancedSearchPopupView.prototype.onShowWithDelay = function ()
|
||||
|
|
|
@ -1005,7 +1005,7 @@
|
|||
{
|
||||
if (Settings.capa(Enums.Capa.SearchAdv))
|
||||
{
|
||||
kn.showScreenPopup(require('View/Popup/AdvancedSearch'));
|
||||
kn.showScreenPopup(require('View/Popup/AdvancedSearch'), [this.mainMessageListSearch()]);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue