|
|
|
@ -2474,6 +2474,7 @@ function rcube_elastic_ui()
|
|
|
|
|
|
|
|
|
|
if (!$(target).data('popup')) {
|
|
|
|
|
$(target).data({
|
|
|
|
|
event: rcube_event.is_keyboard(p.originalEvent) ? 'key' : 'mouse',
|
|
|
|
|
popup: p.name,
|
|
|
|
|
'popup-pos': pos,
|
|
|
|
|
'popup-trigger': 'manual'
|
|
|
|
@ -2878,7 +2879,7 @@ function rcube_elastic_ui()
|
|
|
|
|
/**
|
|
|
|
|
* Mailto menu
|
|
|
|
|
*/
|
|
|
|
|
function mailtomenu(obj, button, event)
|
|
|
|
|
function mailtomenu(obj, button, event, onclick)
|
|
|
|
|
{
|
|
|
|
|
var mailto = $(button).attr('href').replace(/^mailto:/, '');
|
|
|
|
|
|
|
|
|
@ -2886,9 +2887,11 @@ function rcube_elastic_ui()
|
|
|
|
|
return true; // let the browser handle this
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// disable all menu actions
|
|
|
|
|
obj.find('a').off('click').removeClass('active');
|
|
|
|
|
|
|
|
|
|
if (rcmail.env.has_writeable_addressbook) {
|
|
|
|
|
$('.addressbook', obj).addClass('active')
|
|
|
|
|
.off('click').on('click', function(e) {
|
|
|
|
|
$('.addressbook', obj).addClass('active').on('click', function(e) {
|
|
|
|
|
var i, contact = mailto,
|
|
|
|
|
txt = $(button).filter('.rcmContactAddress').text();
|
|
|
|
|
|
|
|
|
@ -2903,11 +2906,20 @@ function rcube_elastic_ui()
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$('.compose', obj).off('click').on('click', function(e) {
|
|
|
|
|
rcmail.command('compose', mailto, this, e.originalEvent);
|
|
|
|
|
$('.compose', obj).addClass('active').on('click', function(e) {
|
|
|
|
|
// Execute the original onclick handler to support mailto URL arguments (#6751)
|
|
|
|
|
if (onclick) {
|
|
|
|
|
button.onclick = onclick;
|
|
|
|
|
// use the second argument to tell our handler to not display the menu again
|
|
|
|
|
$(button).trigger('click', [true]);
|
|
|
|
|
button.onclick = null;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
rcmail.command('compose', mailto, this, e.originalEvent);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return rcmail.command('menu-open', {menu: 'mailto-menu', link: button}, button, event);
|
|
|
|
|
return rcmail.command('menu-open', {menu: 'mailto-menu', link: button}, button, event.originalEvent);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -2915,8 +2927,11 @@ function rcube_elastic_ui()
|
|
|
|
|
*/
|
|
|
|
|
function mailtomenu_append(item)
|
|
|
|
|
{
|
|
|
|
|
$(item).attr('onclick', '').on('click', function(e) {
|
|
|
|
|
return mailtomenu($('#mailto-menu'), item, e);
|
|
|
|
|
// Remember the original onclick handler and display the menu instead
|
|
|
|
|
var onclick = item.onclick;
|
|
|
|
|
item.onclick = null;
|
|
|
|
|
$(item).on('click', function(e, menu) {
|
|
|
|
|
return menu || mailtomenu($('#mailto-menu'), item, e, onclick);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|