Making all if statements have the curly braces.

This commit is contained in:
Randy Merrill 2011-01-21 09:36:21 -08:00
parent 49e782a9eb
commit 3751418fa2

View file

@ -15,9 +15,13 @@
*/
(function($) {
$.timeago = function(timestamp) {
if (timestamp instanceof Date) return inWords(timestamp);
else if (typeof timestamp === "string") return inWords($.timeago.parse(timestamp));
else return inWords($.timeago.datetime(timestamp));
if (timestamp instanceof Date) {
return inWords(timestamp);
} else if (typeof timestamp === "string") {
return inWords($.timeago.parse(timestamp));
} else {
return inWords($.timeago.datetime(timestamp));
}
};
var $t = $.timeago;
@ -122,7 +126,9 @@
if (!element.data("timeago")) {
element.data("timeago", { datetime: $t.datetime(element) });
var text = $.trim(element.text());
if (text.length > 0) element.attr("title", text);
if (text.length > 0) {
element.attr("title", text);
}
}
return element.data("timeago");
}