diff options
author | Aleksander Machniak <alec@alec.pl> | 2014-03-05 14:02:34 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2014-03-05 14:02:34 +0100 |
commit | aa058736111255cfd43e75d1c340d23879663ee2 (patch) | |
tree | 508e41ac91953344aa70e93e56bdc8a0de309d57 /plugins/managesieve/managesieve.js | |
parent | 18a9b4f2f1cbac734d2d16252b45d7ab11bc746f (diff) | |
parent | 324805e180d56bcec52b77d27c752ed2479ce466 (diff) |
Merge branch 'master' of github.com:roundcube/roundcubemail
Diffstat (limited to 'plugins/managesieve/managesieve.js')
-rw-r--r-- | plugins/managesieve/managesieve.js | 16 |
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); |