diff options
author | Aleksander Machniak <alec@alec.pl> | 2017-11-27 21:26:12 +0300 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2017-11-27 21:26:12 +0300 |
commit | 3b0e3deb21525ae037d4a4205fbbcb891fb53f2f (patch) | |
tree | 2e0716e67a37e097077665130718b85c3fc84660 /plugins | |
parent | 550e2fc6aab6d2d0e5dce8ed4d1c8e5c93d164a6 (diff) |
Fix js error on servers without 'mime' extension
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php | 2 | ||||
-rw-r--r-- | plugins/managesieve/managesieve.js | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php b/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php index c34e7a63c..5cb42ddba 100644 --- a/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php +++ b/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php @@ -1865,7 +1865,7 @@ class rcube_sieve_engine $mime_type = ''; $select_mime = new html_select(array('name' => '_rule_mime_type[]', 'id' => 'rule_mime_type' . $id, 'style' => 'min-width:8em', 'onchange' => 'rule_mime_select(' . $id . ')')); - $select_mime->add('', ''); + $select_mime->add('-', ''); foreach (array('contenttype', 'type', 'subtype', 'param') as $val) { if (isset($rule['mime-' . $val])) { diff --git a/plugins/managesieve/managesieve.js b/plugins/managesieve/managesieve.js index 45a7894ad..938904e58 100644 --- a/plugins/managesieve/managesieve.js +++ b/plugins/managesieve/managesieve.js @@ -659,10 +659,12 @@ function rule_header_select(id) size.style.display = 'none'; op.style.display = ''; comp.style.display = ''; - mime.style.display = is_header ? '' : 'none'; - mime_part.style.display = is_header ? '' : 'none'; mod.style.display = is_header ? '' : 'none'; trans.style.display = h == 'body' ? '' : 'none'; + if (mime) + mime.style.display = is_header ? '' : 'none'; + if (mime_part) + mime_part.style.display = is_header ? '' : 'none'; if (msg) msg.style.display = h == 'message' ? '' : 'none'; } @@ -741,9 +743,11 @@ function rule_adv_switch(id, elem) function rule_mime_select(id) { - var elem = $('#rule_mime_type' + id); + var elem = $('#rule_mime_type' + id), + param_elem = $('#rule_mime_param' + id + '_list'); - elem.parent().find('.listarea')[0].style.display = elem.val() == 'param' ? '' : 'none'; + if (param_elem.length) + param_elem[0].style.display = elem.val() == 'param' ? '' : 'none'; }; function action_type_select(id) |