mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-16 18:31:26 +01:00
Only email addresses in mail app need the hover popup, so move it into mail app.
This commit is contained in:
parent
76357f3451
commit
2e72b12452
@ -332,43 +332,4 @@ var et2_url_ro = et2_valueWidget.extend([et2_IDetachedDOM],
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
et2_register_widget(et2_url_ro, ["url_ro", "url-email_ro", "url-phone_ro"]);
|
et2_register_widget(et2_url_ro, ["url_ro", "url-email_ro", "url-phone_ro"]);
|
||||||
|
|
||||||
// Bind a mouseenter event once for every read-only email
|
|
||||||
$j(function() {
|
|
||||||
// If user doesn't have access to addressbook, stop
|
|
||||||
if(!egw.app('addressbook')) return;
|
|
||||||
|
|
||||||
$j('body').on('mouseenter', 'a.et2_email', function() {
|
|
||||||
|
|
||||||
// Disabled for addressbook links - no point, they'd already be a contact
|
|
||||||
if(this.id.indexOf('addressbook-') === 0) return;
|
|
||||||
|
|
||||||
$j(this).tooltip({
|
|
||||||
items: 'a.et2_email',
|
|
||||||
position: {my:"left top", at:"left bottom", collision:"flipfit"},
|
|
||||||
tooltipClass: "et2_email_popup",
|
|
||||||
content: function() {
|
|
||||||
// Here we could do all sorts of things
|
|
||||||
var extra = {
|
|
||||||
'presets[email]': $j(this).text()
|
|
||||||
};
|
|
||||||
return $j('<a href="#">'+ egw.lang('Add a new contact') + '</a>')
|
|
||||||
.on('click', function() {
|
|
||||||
egw.open('','addressbook','add',extra);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
close: function( event, ui ) {
|
|
||||||
ui.tooltip.hover(
|
|
||||||
function () {
|
|
||||||
$j(this).stop(true).fadeTo(400, 1);
|
|
||||||
//.fadeIn("slow"); // doesn't work because of stop()
|
|
||||||
},
|
|
||||||
function () {
|
|
||||||
$j(this).fadeOut("400", function(){ $j(this).remove(); })
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}).tooltip("open");
|
|
||||||
});
|
|
||||||
});
|
|
@ -509,7 +509,7 @@ app.classes.mail = AppJS.extend(
|
|||||||
for(var i = 0; i < content.length; i++)
|
for(var i = 0; i < content.length; i++)
|
||||||
{
|
{
|
||||||
var value = content[i];
|
var value = content[i];
|
||||||
var email = et2_createWidget('url-email',{value:value,readonly:true},widget);
|
var email = et2_createWidget('url-email',{id:widget.id+'_'+i, value:value,readonly:true},widget);
|
||||||
email.loadingFinished();
|
email.loadingFinished();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2816,3 +2816,38 @@ app.classes.mail = AppJS.extend(
|
|||||||
this.egw.message('Not yet implemented ;-)');
|
this.egw.message('Not yet implemented ;-)');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Bind a mouseenter event once for every read-only email
|
||||||
|
$j(function() {
|
||||||
|
// If user doesn't have access to addressbook, stop
|
||||||
|
if(!egw.app('addressbook')) return;
|
||||||
|
|
||||||
|
$j('body').on('mouseenter', 'a[id^="mail-"].et2_email', function() {
|
||||||
|
$j(this).tooltip({
|
||||||
|
items: 'a.et2_email',
|
||||||
|
position: {my:"left top", at:"left bottom", collision:"flipfit"},
|
||||||
|
tooltipClass: "et2_email_popup",
|
||||||
|
content: function() {
|
||||||
|
// Here we could do all sorts of things
|
||||||
|
var extra = {
|
||||||
|
'presets[email]': $j(this).text()
|
||||||
|
};
|
||||||
|
return $j('<a href="#">'+ egw.lang('Add a new contact') + '</a>')
|
||||||
|
.on('click', function() {
|
||||||
|
egw.open('','addressbook','add',extra);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
close: function( event, ui ) {
|
||||||
|
ui.tooltip.hover(
|
||||||
|
function () {
|
||||||
|
$j(this).stop(true).fadeTo(400, 1);
|
||||||
|
//.fadeIn("slow"); // doesn't work because of stop()
|
||||||
|
},
|
||||||
|
function () {
|
||||||
|
$j(this).fadeOut("400", function(){ $j(this).remove(); })
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}).tooltip("open");
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user