From fb5255e2f0bcd69b7fd45889bcda0fd4ad332ca1 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 26 Feb 2014 20:23:46 +0100 Subject: Fix filter creation from an email when preview frame is disabled (#1489647) --- plugins/managesieve/managesieve.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'plugins/managesieve/managesieve.js') 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 = '
'+this.gettext('managesieve.usedata')+'
'; dialog.html(html); -- cgit v1.2.3