Bug fix while checking for undefined attached data

This commit is contained in:
Ryan McGeary 2010-02-16 07:49:41 -05:00
parent a7df538960
commit 7ba0c76ef6

View file

@ -113,7 +113,7 @@
function prepareData(element) { function prepareData(element) {
element = $(element); element = $(element);
if (element.data("timeago") === undefined) { if (!element.data("timeago")) {
element.data("timeago", { datetime: $t.datetime(element) }); element.data("timeago", { datetime: $t.datetime(element) });
var text = $.trim(element.text()); var text = $.trim(element.text());
if (text.length > 0) element.attr("title", text); if (text.length > 0) element.attr("title", text);