Markasjunk: Fix regression in jsevent driver #7361 (#7365)

pull/7370/head
johndoh 5 years ago committed by GitHub
parent 8fac36e2c2
commit ec86e3cb7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -34,6 +34,12 @@ class markasjunk_jsevent
public function init()
{
$rcmail = rcmail::get_instance();
// only execute this code on page load
if ($rcmail->output->type != 'html')
return;
$js_addition_spam_folders = json_encode($this->addition_spam_folders);
$js_suspicious_folders = json_encode($this->suspicious_folders);
@ -44,7 +50,7 @@ rcmail.addEventListener('markasjunk-update', function(props) {
// ignore this special code when in a multifolder listing
if (rcmail.is_multifolder_listing())
return;
return;
if ($.inArray(rcmail.env.mailbox, addition_spam_folders) > -1) {
props.disp.spam = false;
@ -58,14 +64,13 @@ rcmail.addEventListener('markasjunk-update', function(props) {
props.objs.spamobj.find('a > span').text('As possibly spam');
}
else {
props.objs.spamobj.find('a > span').text(rcmail.get_label('markasjunk.markasjunk'));
props.objs.spamobj.find('a > span').text(rcmail.get_label('markasjunk.markasjunk'));
}
return props;
});
EOL;
$rcmail = rcmail::get_instance();
$rcmail->output->add_script($script, 'docready');
}

Loading…
Cancel
Save