odoo/addons/web/static/lib/jquery.tipTip/jquery.tipTip.fme.patch

35 lines
1.1 KiB
Diff

--- jquery.tipTip_old.js 2011-11-14 14:05:53.000000000 +0100
+++ jquery.tipTip.js 2011-11-14 14:41:34.000000000 +0100
@@ -31,7 +31,7 @@
fadeIn: 200,
fadeOut: 200,
attribute: "title",
- content: false, // HTML or String to fill TipTIp with
+ content: false, // HTML String or function to fill TipTIp with
enter: function(){},
exit: function(){}
};
@@ -51,12 +51,7 @@
return this.each(function(){
var org_elem = $(this);
- if(opts.content){
- var org_title = opts.content;
- } else {
- var org_title = org_elem.attr(opts.attribute);
- }
- if(org_title != ""){
+ if(opts.content || org_elem.attr(opts.attribute)){
if(!opts.content){
org_elem.removeAttr(opts.attribute); //remove original Attribute
}
@@ -99,6 +94,8 @@
function active_tiptip(){
opts.enter.call(this);
+ var org_title = typeof opts.content === 'function' ? opts.content() : opts.content;
+ org_title = org_title || org_elem.attr(opts.attribute);
tiptip_content.html(org_title);
tiptip_holder.hide().removeAttr("class").css("margin","0");
tiptip_arrow.removeAttr("style");