Thomas Bruederli
2016-01-16 4a408843b0ef816daf70a472a02b78cd6073a4d5
plugins/zipdownload/zipdownload.js
@@ -43,21 +43,10 @@
            link.html('').append(span);
        }
        span.addClass('folder-selector-link').text(rcmail.gettext('zipdownload.download'));
        span.text(rcmail.get_label('zipdownload.download'));
        rcmail.env.download_link = link;
    });
    // hide menu on click out of menu element
    var fn = function(e) {
        var menu = $('#zipdownload-menu');
        if (e.target != menu.get(0))
            menu.hide();
    };
    $(document.body).on('mouseup', fn);
    $('iframe').contents().on('mouseup', fn)
        .load(function(e) { try { $(this).contents().on('mouseup', fn); } catch(e) {}; });
});
  });
function rcmail_zipdownload(mode)
@@ -65,7 +54,7 @@
    // default .eml download of single message
    if (mode == 'eml') {
        var uid = rcmail.get_single_uid();
        rcmail.goto_url('viewsource', {_uid: uid, _mbox: rcmail.get_message_mailbox(uid), _save: 1});
        rcmail.goto_url('viewsource', rcmail.params_from_uid(uid, {_save: 1}), false, true);
        return;
    }
@@ -100,14 +89,10 @@
}
// display download options menu
function rcmail_zipdownload_menu()
function rcmail_zipdownload_menu(e)
{
    // fix menu style and display menu
    var z_index = rcmail.env.download_link.parents('.popupmenu').css('z-index'),
        menu = $('#zipdownload-menu').css({'max-height': 'none', 'z-index': z_index + 1}).show();
    // position menu on the screen
    rcmail.element_position(menu, rcmail.env.download_link);
    // show (sub)menu for download selection
    rcmail.command('menu-open', 'zipdownload-menu', e && e.target ? e.target : rcmail.env.download_link, e);
    // abort default download action
    return false;