summaryrefslogtreecommitdiff
path: root/plugins/managesieve/managesieve.js
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2014-02-26 20:23:46 +0100
committerAleksander Machniak <alec@alec.pl>2014-02-26 20:24:46 +0100
commit1edb6bbc255c63e26d447ede8fd4f1385e72579b (patch)
tree7918f7b03398e66a54e667832d6706c3d02db599 /plugins/managesieve/managesieve.js
parent1c715f79b4e3fdc3b80d27f8fc0bcdde2b0dfed8 (diff)
Fix filter creation from an email when preview frame is disabled (#1489647)
Diffstat (limited to 'plugins/managesieve/managesieve.js')
-rw-r--r--plugins/managesieve/managesieve.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/plugins/managesieve/managesieve.js b/plugins/managesieve/managesieve.js
index 8e344ad54..6b36127d3 100644
--- a/plugins/managesieve/managesieve.js
+++ b/plugins/managesieve/managesieve.js
@@ -801,9 +801,17 @@ rcube_webmail.prototype.managesieve_tip_register = function(tips)
/********* Mail UI methods *********/
/*********************************************************/
-rcube_webmail.prototype.managesieve_create = function()
+rcube_webmail.prototype.managesieve_create = function(force)
{
- if (!rcmail.env.sieve_headers || !rcmail.env.sieve_headers.length)
+ if (!force && this.env.action != 'show' && !$('#'+this.env.contentframe).is(':visible')) {
+ var uid = this.message_list.get_single_selection(),
+ lock = this.set_busy(true, 'loading');
+
+ this.http_post('plugin.managesieve-action', {_uid: uid}, lock);
+ return;
+ }
+
+ if (!this.env.sieve_headers || !this.env.sieve_headers.length)
return;
var i, html, buttons = {}, dialog = $("#sievefilterform");
@@ -816,9 +824,9 @@ rcube_webmail.prototype.managesieve_create = function()
// build dialog window content
html = '<fieldset><legend>'+this.gettext('managesieve.usedata')+'</legend><ul>';
- for (i in rcmail.env.sieve_headers)
+ for (i in this.env.sieve_headers)
html += '<li><input type="checkbox" name="headers[]" id="sievehdr'+i+'" value="'+i+'" checked="checked" />'
- +'<label for="sievehdr'+i+'">'+rcmail.env.sieve_headers[i][0]+':</label> '+rcmail.env.sieve_headers[i][1]+'</li>';
+ +'<label for="sievehdr'+i+'">'+this.env.sieve_headers[i][0]+':</label> '+this.env.sieve_headers[i][1]+'</li>';
html += '</ul></fieldset>';
dialog.html(html);