summaryrefslogtreecommitdiff
path: root/web-ui
diff options
context:
space:
mode:
authorGiovane <giovaneliberato@gmail.com>2015-11-13 14:45:03 -0200
committerGiovane <giovaneliberato@gmail.com>2015-11-13 14:45:03 -0200
commit345af818469a46b28eb2904b5456f9f81ede2d9f (patch)
tree1b5a2fc8be178e11a0915239ad0dcffd34e18167 /web-ui
parentc032520f8f979a139b858df8272aa6511c41244a (diff)
Remove search engine query lookups when showing no mails available #503
Diffstat (limited to 'web-ui')
-rw-r--r--web-ui/app/js/mail_view/ui/no_mails_available_pane.js4
-rw-r--r--web-ui/app/js/services/mail_service.js2
2 files changed, 4 insertions, 2 deletions
diff --git a/web-ui/app/js/mail_view/ui/no_mails_available_pane.js b/web-ui/app/js/mail_view/ui/no_mails_available_pane.js
index baa54fe3..7025dca6 100644
--- a/web-ui/app/js/mail_view/ui/no_mails_available_pane.js
+++ b/web-ui/app/js/mail_view/ui/no_mails_available_pane.js
@@ -34,9 +34,11 @@ define(
forSearch: ''
});
+ var mailsQueryMatch = /-?in:"[\w]+"|tag:"[\w]+"/g;
+
this.render = function() {
this.attr.tag = this.attr.tag.toUpperCase();
- this.attr.forSearch = this.attr.forSearch.toUpperCase();
+ this.attr.forSearch = this.attr.forSearch.replace(mailsQueryMatch, '').trim();
this.$node.html(templates.noMailsAvailable(this.attr));
};
diff --git a/web-ui/app/js/services/mail_service.js b/web-ui/app/js/services/mail_service.js
index 3dae9df8..e655bb7e 100644
--- a/web-ui/app/js/services/mail_service.js
+++ b/web-ui/app/js/services/mail_service.js
@@ -222,7 +222,7 @@ define(
monitoredAjax(this, url, { dataType: 'json' })
.done(function (data) {
this.attr.numPages = Math.ceil(data.stats.total / this.attr.pageSize);
- this.trigger(document, events.mails.available, _.merge(_.merge({tag: this.attr.currentTag, forSearch: this.attr.lastQuery }), this.parseMails(data)));
+ this.trigger(document, events.mails.available, _.merge({tag: this.attr.currentTag, forSearch: this.attr.lastQuery }, this.parseMails(data)));
}.bind(this))
.fail(function () {
this.trigger(document, events.ui.userAlerts.displayMessage, { message: i18n('Could not fetch messages') });