Bind onmouseenter event of add contact+ button on url-email set_value, as widget might be created by apps client side code, not directly loaded from xet file

This commit is contained in:
Hadi Nategh 2014-09-02 09:33:43 +00:00
parent 2abc38e08e
commit e7bc170c4e

View File

@ -308,39 +308,8 @@ var et2_url_ro = et2_valueWidget.extend([et2_IDetachedDOM],
this.span.attr("target", "_blank"); this.span.attr("target", "_blank");
} }
} }
break;
}
},
/**
* Code for implementing et2_IDetachedDOM
*
* @param {array} _attrs array to add further attributes to
*/
getDetachedAttributes: function(_attrs)
{
_attrs.push("value", "class");
},
getDetachedNodes: function()
{
return [this.span[0]];
},
setDetachedAttributes: function(_nodes, _values)
{
// Update the properties
this.span = jQuery(_nodes[0]);
if (typeof _values["value"] != "undefined")
{
this.set_value(_values["value"]);
}
if (typeof _values["class"] != "undefined")
{
_nodes[0].setAttribute("class", _values["class"]);
}
// Add contact_plus button // Add contact_plus button
if (this.options.contact_plus && this._type == "url-email" ) if (this.options.contact_plus)
{ {
// If user doesn't have access to addressbook, stop // If user doesn't have access to addressbook, stop
if(!egw.app('addressbook')) return; if(!egw.app('addressbook')) return;
@ -384,6 +353,38 @@ var et2_url_ro = et2_valueWidget.extend([et2_IDetachedDOM],
}, },
}); });
} }
break;
}
},
/**
* Code for implementing et2_IDetachedDOM
*
* @param {array} _attrs array to add further attributes to
*/
getDetachedAttributes: function(_attrs)
{
_attrs.push("value", "class");
},
getDetachedNodes: function()
{
return [this.span[0]];
},
setDetachedAttributes: function(_nodes, _values)
{
// Update the properties
this.span = jQuery(_nodes[0]);
if (typeof _values["value"] != "undefined")
{
this.set_value(_values["value"]);
}
if (typeof _values["class"] != "undefined")
{
_nodes[0].setAttribute("class", _values["class"]);
}
} }
}); });
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"]);