diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2014-05-08 18:19:20 +0200 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2014-05-08 18:19:20 +0200 |
commit | 6789bf1f4dfd32cd54a0fbe520ff3e1a6f6afb8a (patch) | |
tree | 7fe8a301a1fa514f7225424a26047d4cf7bfa79d /plugins/zipdownload | |
parent | ea0866a1adc9239b8b115ab2490e1dd88f3c64ec (diff) |
Moved popup-menu functions to Roundcube core for seamless integration of (stackable) skin and core menus
Diffstat (limited to 'plugins/zipdownload')
-rw-r--r-- | plugins/zipdownload/zipdownload.js | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/plugins/zipdownload/zipdownload.js b/plugins/zipdownload/zipdownload.js index 644c1e030..af9136c1d 100644 --- a/plugins/zipdownload/zipdownload.js +++ b/plugins/zipdownload/zipdownload.js @@ -43,21 +43,10 @@ window.rcmail && rcmail.addEventListener('init', function(evt) { link.html('').append(span); } - span.addClass('folder-selector-link').text(rcmail.gettext('zipdownload.download')); - + span.text(rcmail.gettext('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) @@ -100,14 +89,10 @@ function rcmail_zipdownload(mode) } // 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; |