From 91a484a713f2e58e32c99d93aefe2f9b6fc2468d Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Mon, 9 Feb 2015 14:23:29 +0100 Subject: [PATCH] Let Roundcube core handle the popup menus (#4529) --- plugins/tasklist/tasklist.js | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/plugins/tasklist/tasklist.js b/plugins/tasklist/tasklist.js index 70210165..34cd97c0 100644 --- a/plugins/tasklist/tasklist.js +++ b/plugins/tasklist/tasklist.js @@ -604,9 +604,6 @@ function rcube_tasklist_ui(settings) return false; }); - // handle global document clicks: close popup menus - $(document.body).click(clear_popups); - // extended datepicker settings var extended_datepicker_settings = $.extend({ showButtonPanel: true, @@ -1778,7 +1775,7 @@ function rcube_tasklist_ui(settings) return $.grep(oldies, function(cls) { return cls.indexOf('status-') === 0 }).join(' '); }); - if (!(rec = listdata[id]) || clear_popups({})) + if (!(rec = listdata[id]) || (rcmail.menu_stack && rcmail.menu_stack.length > 0)) return; me.selected_task = rec; @@ -2879,25 +2876,6 @@ function rcube_tasklist_ui(settings) } } - /** - * Hide all open popup menus - */ - function clear_popups(e) - { - var count = 0, target = e.target; - if (target && target.className == 'inner') - target = e.target.parentNode; - - $('.popupmenu:visible').each(function(i, elem){ - var menu = $(elem), id = elem.id; - if (id && target.id != id+'link' && (!menu.data('sticky') || !target_overlaps(e.target, elem))) { - menu.hide(); - count++; - } - }); - return count; - } - /** * Check whether the event target is a descentand of the given element */