mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-08 17:07:03 +03:00
Fix search builder
This commit is contained in:
parent
68890f8083
commit
3217303a65
3 changed files with 26 additions and 3 deletions
|
|
@ -31,7 +31,7 @@ export function momentNowUnix()
|
||||||
*/
|
*/
|
||||||
export function searchSubtractFormatDateHelper(date)
|
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);
|
kn.extendAsViewModel(['View/Popup/AdvancedSearch', 'PopupsAdvancedSearchViewModel'], AdvancedSearchPopupView);
|
||||||
_.extend(AdvancedSearchPopupView.prototype, AbstractView.prototype);
|
_.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)
|
AdvancedSearchPopupView.prototype.buildSearchStringValue = function (sValue)
|
||||||
{
|
{
|
||||||
if (-1 < sValue.indexOf(' '))
|
if (-1 < sValue.indexOf(' '))
|
||||||
|
|
@ -156,9 +178,10 @@
|
||||||
this.fromFocus(true);
|
this.fromFocus(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
AdvancedSearchPopupView.prototype.onShow = function ()
|
AdvancedSearchPopupView.prototype.onShow = function (search)
|
||||||
{
|
{
|
||||||
this.clearPopup();
|
this.clearPopup();
|
||||||
|
this.parseSearchStringValue(search);
|
||||||
};
|
};
|
||||||
|
|
||||||
AdvancedSearchPopupView.prototype.onShowWithDelay = function ()
|
AdvancedSearchPopupView.prototype.onShowWithDelay = function ()
|
||||||
|
|
|
||||||
|
|
@ -1005,7 +1005,7 @@
|
||||||
{
|
{
|
||||||
if (Settings.capa(Enums.Capa.SearchAdv))
|
if (Settings.capa(Enums.Capa.SearchAdv))
|
||||||
{
|
{
|
||||||
kn.showScreenPopup(require('View/Popup/AdvancedSearch'));
|
kn.showScreenPopup(require('View/Popup/AdvancedSearch'), [this.mainMessageListSearch()]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue